summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-04-26 06:39:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-04-26 06:39:12 (GMT)
commite31159746e30a24d7064bf30491ccd73444eb00a (patch)
tree4fc61f845670e28417a989d24fc37e7e91d645d3 /t
parent7ba7bff6294153449453b27ebdcb2ad2e751736d (diff)
parent507e6e9eecce5e7a2cc204c844bbb2f9b17b31e3 (diff)
downloadgit-e31159746e30a24d7064bf30491ccd73444eb00a.zip
git-e31159746e30a24d7064bf30491ccd73444eb00a.tar.gz
git-e31159746e30a24d7064bf30491ccd73444eb00a.tar.bz2
Merge branch 'nd/worktree-add-lock'
Allow to lock a worktree immediately after it's created. This helps prevent a race between "git worktree add; git worktree lock" and "git worktree prune". * nd/worktree-add-lock: worktree add: add --lock option
Diffstat (limited to 't')
-rwxr-xr-xt/t2025-worktree-add.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t2025-worktree-add.sh b/t/t2025-worktree-add.sh
index b618d6b..b5c47ac 100755
--- a/t/t2025-worktree-add.sh
+++ b/t/t2025-worktree-add.sh
@@ -63,6 +63,12 @@ test_expect_success '"add" worktree' '
)
'
+test_expect_success '"add" worktree with lock' '
+ git rev-parse HEAD >expect &&
+ git worktree add --detach --lock here-with-lock master &&
+ test -f .git/worktrees/here-with-lock/locked
+'
+
test_expect_success '"add" worktree from a subdir' '
(
mkdir sub &&