Skip to content

Commit e6d5a11

Browse files
alipman88gitster
authored andcommitted
t3200: clean side effect of git checkout --orphan
The "refuse --edit-description on unborn branch for now" test in t3200 switches to an orphan branch, causing subsequent git commands referencing HEAD to fail. Avoid this side-effect by switching back to master after the test finishes. This has gone undetected, as the next affected test expects failure - but it currently fails for the wrong reason. Verbose output of the next test referencing HEAD, "--merged is incompatible with --no-merged": fatal: malformed object name HEAD Which this commit corrects to: error: option `no-merged' is incompatible with --merged Signed-off-by: Aaron Lipman <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 47ae905 commit e6d5a11

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

t/t3200-branch.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,6 +1287,7 @@ test_expect_success 'detect typo in branch name when using --edit-description' '
12871287
'
12881288

12891289
test_expect_success 'refuse --edit-description on unborn branch for now' '
1290+
test_when_finished "git checkout master" &&
12901291
write_script editor <<-\EOF &&
12911292
echo "New contents" >"$1"
12921293
EOF

0 commit comments

Comments
 (0)