]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'nd/corrupt-worktrees'
authorJunio C Hamano <gitster@pobox.com>
Thu, 13 Jun 2019 20:19:41 +0000 (13:19 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 13 Jun 2019 20:19:41 +0000 (13:19 -0700)
"git worktree add" used to fail when another worktree connected to
the same repository was corrupt, which has been corrected.

* nd/corrupt-worktrees:
  worktree add: be tolerant of corrupt worktrees

1  2 
t/t2400-worktree-add.sh
worktree.c

index c989dbe321deb333517c59d95d6692032aaea94b,d83a9f0fdc0faaef9756166f7b6223212514a7d6..e819ba741ec96018755a08ef956998edfdd1dcc4
@@@ -570,9 -570,16 +570,21 @@@ test_expect_success '"add" an existing 
        git worktree add --force --force --detach gnoo
  '
  
 +test_expect_success FUNNYNAMES 'sanitize generated worktree name' '
 +      git worktree add --detach ".  weird*..?.lock.lock" &&
 +      test -d .git/worktrees/---weird-.-
 +'
 +
+ test_expect_success '"add" should not fail because of another bad worktree' '
+       git init add-fail &&
+       (
+               cd add-fail &&
+               test_commit first &&
+               mkdir sub &&
+               git worktree add sub/to-be-deleted &&
+               rm -rf sub &&
+               git worktree add second
+       )
+ '
  test_done
diff --cc worktree.c
Simple merge