Thread (4 messages) flat view 4 messages, 4 authors, 2016-06-15

Re: [PATCH] setup: do not create $X/gitdir unnecessarily when accessing git file $X

From: Eric Sunshine <hidden>
Date: 2016-06-15 23:07:09

Possibly related (same subject, not in this thread)

On Mon, Nov 2, 2015 at 2:08 PM, Nguyễn Thái Ngọc Duy [off-list ref] wrote:
quoted hunk ↗ jump to hunk
$X/gitdir is created, or refreshed, in order to keep a linked worktree
from being pruned. But while git file is used as the foundation for
linked worktrees, it's used for other purposes as well and we should
not create $X/gitdir in those cases.

Tighten the check. Only update an existing file, which is an
indication this is a linked worktree.

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
---
diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh
@@ -99,6 +99,13 @@ test_expect_success 'check rev-list' '
+test_expect_success '$REAL/gitdir is not created on ordinary git file' '
+       echo "gitdir: $REAL" >expected &&
+       test_cmp expected .git &&
+       git status &&
+       ! test -f "$REAL"/gitdir
Minor: test_path_is_missing() might convey the intention a bit more clearly.
+'
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help