Skip to content

Commit f2515d9

Browse files
peffgitster
authored andcommitted
t3308: create a real ref directory/file conflict
A test in t3308 wants to make sure that we don't accidentally merge into "refs/notes/dir" when it exists as a directory, so it does: mkdir .git/refs/notes/dir git -c core.notesRef=refs/notes/dir merge ... and expects the second command to fail. But that understimates the refs code, which is smart enough to remove useless directories in the refs hierarchy. The test succeeded only because of a bug which prevented resolving refs/notes/dir for writing, even though an actual ref update would succeed. In preparation for fixing that bug, let's switch to creating a real ref in refs/notes/dir, which is a more realistic situation. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 217f276 commit f2515d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t3308-notes-merge.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ test_expect_success 'fail to merge empty notes ref into empty notes ref (z => y)
7979
test_expect_success 'fail to merge into various non-notes refs' '
8080
test_must_fail git -c "core.notesRef=refs/notes" notes merge x &&
8181
test_must_fail git -c "core.notesRef=refs/notes/" notes merge x &&
82-
mkdir -p .git/refs/notes/dir &&
82+
git update-ref refs/notes/dir/foo HEAD &&
8383
test_must_fail git -c "core.notesRef=refs/notes/dir" notes merge x &&
8484
test_must_fail git -c "core.notesRef=refs/notes/dir/" notes merge x &&
8585
test_must_fail git -c "core.notesRef=refs/heads/master" notes merge x &&

0 commit comments

Comments
 (0)