diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-04-26 08:39:12 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-04-26 08:39:12 +0200 |
commit | e31159746e30a24d7064bf30491ccd73444eb00a (patch) | |
tree | 4fc61f845670e28417a989d24fc37e7e91d645d3 /t | |
parent | Merge branch 'jk/update-links-in-docs' (diff) | |
parent | worktree add: add --lock option (diff) | |
download | git-e31159746e30a24d7064bf30491ccd73444eb00a.tar.xz git-e31159746e30a24d7064bf30491ccd73444eb00a.zip |
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-x | t/t2025-worktree-add.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t2025-worktree-add.sh b/t/t2025-worktree-add.sh index b618d6be21..b5c47ac602 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 && |