Merge branch 'jk/clang-pedantic' into maint
[gitweb.git] / t / t1400-update-ref.sh
index 97406fa4b137afdd99e64172d956718005844120..af1b20dd5c6763e58eccd3f93722987f5f9ce233 100755 (executable)
@@ -1130,4 +1130,23 @@ test_expect_success ULIMIT_FILE_DESCRIPTORS 'large transaction deleting branches
 )
 '
 
+test_expect_success 'handle per-worktree refs in refs/bisect' '
+       git commit --allow-empty -m "initial commit" &&
+       git worktree add -b branch worktree &&
+       (
+               cd worktree &&
+               git commit --allow-empty -m "test commit"  &&
+               git for-each-ref >for-each-ref.out &&
+               ! grep refs/bisect for-each-ref.out &&
+               git update-ref refs/bisect/something HEAD &&
+               git rev-parse refs/bisect/something >../worktree-head &&
+               git for-each-ref | grep refs/bisect/something
+       ) &&
+       test_path_is_missing .git/refs/bisect &&
+       test_must_fail git rev-parse refs/bisect/something &&
+       git update-ref refs/bisect/something HEAD &&
+       git rev-parse refs/bisect/something >main-head &&
+       ! test_cmp main-head worktree-head
+'
+
 test_done