Skip to content

Commit b0a61ab

Browse files
moygitster
authored andcommitted
status: suggest 'git merge --abort' when appropriate
We already suggest 'git rebase --abort' during a conflicted rebase. Similarly, suggest 'git merge --abort' during conflict resolution on 'git merge'. Signed-off-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e465796 commit b0a61ab

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

t/t7060-wtstatus.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ test_expect_success 'M/D conflict does not segfault' '
3434
On branch side
3535
You have unmerged paths.
3636
(fix conflicts and run "git commit")
37+
(use "git merge --abort" to abort the merge)
3738
3839
Unmerged paths:
3940
(use "git add/rm <file>..." as appropriate to mark resolution)
@@ -138,6 +139,7 @@ test_expect_success 'status when conflicts with add and rm advice (deleted by th
138139
On branch master
139140
You have unmerged paths.
140141
(fix conflicts and run "git commit")
142+
(use "git merge --abort" to abort the merge)
141143
142144
Unmerged paths:
143145
(use "git add/rm <file>..." as appropriate to mark resolution)
@@ -171,6 +173,7 @@ test_expect_success 'status when conflicts with add and rm advice (both deleted)
171173
On branch conflict_second
172174
You have unmerged paths.
173175
(fix conflicts and run "git commit")
176+
(use "git merge --abort" to abort the merge)
174177
175178
Unmerged paths:
176179
(use "git add/rm <file>..." as appropriate to mark resolution)
@@ -195,6 +198,7 @@ test_expect_success 'status when conflicts with only rm advice (both deleted)' '
195198
On branch conflict_second
196199
You have unmerged paths.
197200
(fix conflicts and run "git commit")
201+
(use "git merge --abort" to abort the merge)
198202
199203
Changes to be committed:
200204

t/t7512-status-help.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ test_expect_success 'status when conflicts unresolved' '
2929
On branch conflicts
3030
You have unmerged paths.
3131
(fix conflicts and run "git commit")
32+
(use "git merge --abort" to abort the merge)
3233
3334
Unmerged paths:
3435
(use "git add <file>..." to mark resolution)

wt-status.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -946,9 +946,12 @@ static void show_merge_in_progress(struct wt_status *s,
946946
{
947947
if (has_unmerged(s)) {
948948
status_printf_ln(s, color, _("You have unmerged paths."));
949-
if (s->hints)
949+
if (s->hints) {
950950
status_printf_ln(s, color,
951-
_(" (fix conflicts and run \"git commit\")"));
951+
_(" (fix conflicts and run \"git commit\")"));
952+
status_printf_ln(s, color,
953+
_(" (use \"git merge --abort\" to abort the merge)"));
954+
}
952955
} else {
953956
status_printf_ln(s, color,
954957
_("All conflicts fixed but you are still merging."));

0 commit comments

Comments
 (0)