t/t6132-pathspec-exclude.sh: use the $( ... ) construct for command substitution
[gitweb.git] / t / t1400-update-ref.sh
index 9d21c1927e06312ae49b4c81e1ba53485a49b9de..af1b20dd5c6763e58eccd3f93722987f5f9ce233 100755 (executable)
@@ -174,12 +174,11 @@ test_expect_success "(not) changed .git/$m" "
 '
 rm -f .git/$m
 
-: a repository with working tree always has reflog these days...
-: >.git/logs/refs/heads/master
+rm -f .git/logs/refs/heads/master
 test_expect_success \
        "create $m (logged by touch)" \
        'GIT_COMMITTER_DATE="2005-05-26 23:30" \
-        git update-ref HEAD '"$A"' -m "Initial Creation" &&
+        git update-ref --create-reflog HEAD '"$A"' -m "Initial Creation" &&
         test '"$A"' = $(cat .git/'"$m"')'
 test_expect_success \
        "update $m (logged by touch)" \
@@ -1131,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