@@ -77,7 +77,7 @@ test_expect_success 'status when rebase in progress before resolving conflicts'
7777 ONTO=$(git rev-parse --short HEAD^^) &&
7878 test_must_fail git rebase HEAD^ --onto HEAD^^ &&
7979 cat >expected <<-EOF &&
80- # HEAD detached at $ONTO
80+ # rebase in progress; onto $ONTO
8181 # You are currently rebasing branch ' \' ' rebase_conflicts' \' ' on ' \' ' $ONTO' \' ' .
8282 # (fix conflicts and then run "git rebase --continue")
8383 # (use "git rebase --skip" to skip this patch)
@@ -104,7 +104,7 @@ test_expect_success 'status when rebase in progress before rebase --continue' '
104104 echo three >main.txt &&
105105 git add main.txt &&
106106 cat >expected <<-EOF &&
107- # HEAD detached at $ONTO
107+ # rebase in progress; onto $ONTO
108108 # You are currently rebasing branch ' \' ' rebase_conflicts' \' ' on ' \' ' $ONTO' \' ' .
109109 # (all conflicts fixed: run "git rebase --continue")
110110 #
@@ -136,7 +136,7 @@ test_expect_success 'status during rebase -i when conflicts unresolved' '
136136 ONTO=$(git rev-parse --short rebase_i_conflicts) &&
137137 test_must_fail git rebase -i rebase_i_conflicts &&
138138 cat >expected <<-EOF &&
139- # HEAD detached at $ONTO
139+ # rebase in progress; onto $ONTO
140140 # You are currently rebasing branch ' \' ' rebase_i_conflicts_second' \' ' on ' \' ' $ONTO' \' ' .
141141 # (fix conflicts and then run "git rebase --continue")
142142 # (use "git rebase --skip" to skip this patch)
@@ -162,7 +162,7 @@ test_expect_success 'status during rebase -i after resolving conflicts' '
162162 test_must_fail git rebase -i rebase_i_conflicts &&
163163 git add main.txt &&
164164 cat >expected <<-EOF &&
165- # HEAD detached at $ONTO
165+ # rebase in progress; onto $ONTO
166166 # You are currently rebasing branch ' \' ' rebase_i_conflicts_second' \' ' on ' \' ' $ONTO' \' ' .
167167 # (all conflicts fixed: run "git rebase --continue")
168168 #
@@ -188,10 +188,9 @@ test_expect_success 'status when rebasing -i in edit mode' '
188188 export FAKE_LINES &&
189189 test_when_finished "git rebase --abort" &&
190190 ONTO=$(git rev-parse --short HEAD~2) &&
191- TGT=$(git rev-parse --short two_rebase_i) &&
192191 git rebase -i HEAD~2 &&
193192 cat >expected <<-EOF &&
194- # HEAD detached from $TGT
193+ # rebase in progress; onto $ONTO
195194 # You are currently editing a commit while rebasing branch ' \' ' rebase_i_edit' \' ' on ' \' ' $ONTO' \' ' .
196195 # (use "git commit --amend" to amend the current commit)
197196 # (use "git rebase --continue" once you are satisfied with your changes)
@@ -216,9 +215,8 @@ test_expect_success 'status when splitting a commit' '
216215 ONTO=$(git rev-parse --short HEAD~3) &&
217216 git rebase -i HEAD~3 &&
218217 git reset HEAD^ &&
219- TGT=$(git rev-parse --short HEAD) &&
220218 cat >expected <<-EOF &&
221- # HEAD detached at $TGT
219+ # rebase in progress; onto $ONTO
222220 # You are currently splitting a commit while rebasing branch ' \' ' split_commit' \' ' on ' \' ' $ONTO' \' ' .
223221 # (Once your working directory is clean, run "git rebase --continue")
224222 #
@@ -246,11 +244,10 @@ test_expect_success 'status after editing the last commit with --amend during a
246244 export FAKE_LINES &&
247245 test_when_finished "git rebase --abort" &&
248246 ONTO=$(git rev-parse --short HEAD~3) &&
249- TGT=$(git rev-parse --short three_amend) &&
250247 git rebase -i HEAD~3 &&
251248 git commit --amend -m "foo" &&
252249 cat >expected <<-EOF &&
253- # HEAD detached from $TGT
250+ # rebase in progress; onto $ONTO
254251 # You are currently editing a commit while rebasing branch ' \' ' amend_last' \' ' on ' \' ' $ONTO' \' ' .
255252 # (use "git commit --amend" to amend the current commit)
256253 # (use "git rebase --continue" once you are satisfied with your changes)
@@ -280,7 +277,7 @@ test_expect_success 'status: (continue first edit) second edit' '
280277 git rebase -i HEAD~3 &&
281278 git rebase --continue &&
282279 cat >expected <<-EOF &&
283- # HEAD detached from $ONTO
280+ # rebase in progress; onto $ONTO
284281 # You are currently editing a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
285282 # (use "git commit --amend" to amend the current commit)
286283 # (use "git rebase --continue" once you are satisfied with your changes)
@@ -302,7 +299,7 @@ test_expect_success 'status: (continue first edit) second edit and split' '
302299 git rebase --continue &&
303300 git reset HEAD^ &&
304301 cat >expected <<-EOF &&
305- # HEAD detached from $ONTO
302+ # rebase in progress; onto $ONTO
306303 # You are currently splitting a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
307304 # (Once your working directory is clean, run "git rebase --continue")
308305 #
@@ -329,7 +326,7 @@ test_expect_success 'status: (continue first edit) second edit and amend' '
329326 git rebase --continue &&
330327 git commit --amend -m "foo" &&
331328 cat >expected <<-EOF &&
332- # HEAD detached from $ONTO
329+ # rebase in progress; onto $ONTO
333330 # You are currently editing a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
334331 # (use "git commit --amend" to amend the current commit)
335332 # (use "git rebase --continue" once you are satisfied with your changes)
@@ -351,7 +348,7 @@ test_expect_success 'status: (amend first edit) second edit' '
351348 git commit --amend -m "a" &&
352349 git rebase --continue &&
353350 cat >expected <<-EOF &&
354- # HEAD detached from $ONTO
351+ # rebase in progress; onto $ONTO
355352 # You are currently editing a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
356353 # (use "git commit --amend" to amend the current commit)
357354 # (use "git rebase --continue" once you are satisfied with your changes)
@@ -374,7 +371,7 @@ test_expect_success 'status: (amend first edit) second edit and split' '
374371 git rebase --continue &&
375372 git reset HEAD^ &&
376373 cat >expected <<-EOF &&
377- # HEAD detached from $ONTO
374+ # rebase in progress; onto $ONTO
378375 # You are currently splitting a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
379376 # (Once your working directory is clean, run "git rebase --continue")
380377 #
@@ -402,7 +399,7 @@ test_expect_success 'status: (amend first edit) second edit and amend' '
402399 git rebase --continue &&
403400 git commit --amend -m "d" &&
404401 cat >expected <<-EOF &&
405- # HEAD detached from $ONTO
402+ # rebase in progress; onto $ONTO
406403 # You are currently editing a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
407404 # (use "git commit --amend" to amend the current commit)
408405 # (use "git rebase --continue" once you are satisfied with your changes)
@@ -426,7 +423,7 @@ test_expect_success 'status: (split first edit) second edit' '
426423 git commit -m "e" &&
427424 git rebase --continue &&
428425 cat >expected <<-EOF &&
429- # HEAD detached from $ONTO
426+ # rebase in progress; onto $ONTO
430427 # You are currently editing a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
431428 # (use "git commit --amend" to amend the current commit)
432429 # (use "git rebase --continue" once you are satisfied with your changes)
@@ -451,7 +448,7 @@ test_expect_success 'status: (split first edit) second edit and split' '
451448 git rebase --continue &&
452449 git reset HEAD^ &&
453450 cat >expected <<-EOF &&
454- # HEAD detached from $ONTO
451+ # rebase in progress; onto $ONTO
455452 # You are currently splitting a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
456453 # (Once your working directory is clean, run "git rebase --continue")
457454 #
@@ -481,7 +478,7 @@ test_expect_success 'status: (split first edit) second edit and amend' '
481478 git rebase --continue &&
482479 git commit --amend -m "h" &&
483480 cat >expected <<-EOF &&
484- # HEAD detached from $ONTO
481+ # rebase in progress; onto $ONTO
485482 # You are currently editing a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
486483 # (use "git commit --amend" to amend the current commit)
487484 # (use "git rebase --continue" once you are satisfied with your changes)
@@ -601,7 +598,7 @@ test_expect_success 'status when rebase conflicts with statushints disabled' '
601598 ONTO=$(git rev-parse --short HEAD^^) &&
602599 test_must_fail git rebase HEAD^ --onto HEAD^^ &&
603600 cat >expected <<-EOF &&
604- # HEAD detached at $ONTO
601+ # rebase in progress; onto $ONTO
605602 # You are currently rebasing branch ' \' ' statushints_disabled' \' ' on ' \' ' $ONTO' \' ' .
606603 #
607604 # Unmerged paths:
@@ -669,14 +666,22 @@ test_expect_success 'status when cherry-picking after resolving conflicts' '
669666 test_i18ncmp expected actual
670667'
671668
672- test_expect_success ' status showing detached from a tag' '
669+ test_expect_success ' status showing detached at and from a tag' '
673670 test_commit atag tagging &&
674671 git checkout atag &&
675672 cat >expected <<-\EOF
676673 # HEAD detached at atag
677674 nothing to commit (use -u to show untracked files)
678675 EOF
679676 git status --untracked-files=no >actual &&
677+ test_i18ncmp expected actual &&
678+
679+ git reset --hard HEAD^ &&
680+ cat >expected <<-\EOF
681+ # HEAD detached from atag
682+ nothing to commit (use -u to show untracked files)
683+ EOF
684+ git status --untracked-files=no >actual &&
680685 test_i18ncmp expected actual
681686'
682687
0 commit comments