Skip to content

Commit 3ec7371

Browse files
dschogitster
authored andcommitted
Add two extra tests for git rebase
1 parent 3021faf commit 3ec7371

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

t/t3400-rebase.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ export GIT_AUTHOR_EMAIL
1414

1515
test_expect_success \
1616
'prepare repository with topic branches' \
17-
'echo First > A &&
17+
'git config core.logAllRefUpdates true &&
18+
echo First > A &&
1819
git update-index --add A &&
1920
git commit -m "Add A." &&
2021
git checkout -b my-topic-branch &&
@@ -84,4 +85,14 @@ test_expect_success 'rebase a single mode change' '
8485
GIT_TRACE=1 git rebase master
8586
'
8687

88+
test_expect_success 'HEAD was detached during rebase' '
89+
test $(git rev-parse HEAD@{1}) != $(git rev-parse modechange@{1})
90+
'
91+
92+
test_expect_success 'Show verbose error when HEAD could not be detached' '
93+
: > B &&
94+
test_must_fail git rebase topic 2> output.err > output.out &&
95+
grep "Untracked working tree file .B. would be overwritten" output.err
96+
'
97+
8798
test_done

0 commit comments

Comments
 (0)