Skip to content

Commit 6f90969

Browse files
Michael J Grubergitster
authored andcommitted
unpack-trees: print "Aborting" to stderr
display_error_msgs() prints all the errors to stderr already (if any), followed by "Aborting" (if any) to stdout. Make the latter go to stderr instead. Signed-off-by: Michael J Gruber <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f696543 commit 6f90969

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

t/t7607-merge-overwrite.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ error: The following untracked working tree files would be overwritten by merge:
107107
sub
108108
sub2
109109
Please move or remove them before you can merge.
110+
Aborting
110111
EOF
111112

112113
test_expect_success 'will not overwrite untracked file in leading path' '

t/t7609-merge-co-error-msgs.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ error: The following untracked working tree files would be overwritten by merge:
3232
three
3333
two
3434
Please move or remove them before you can merge.
35+
Aborting
3536
EOF
3637

3738
test_expect_success 'untracked files overwritten by merge (fast and non-fast forward)' '
@@ -56,6 +57,7 @@ Please, commit your changes or stash them before you can merge.
5657
error: The following untracked working tree files would be overwritten by merge:
5758
five
5859
Please move or remove them before you can merge.
60+
Aborting
5961
EOF
6062

6163
test_expect_success 'untracked files or local changes ovewritten by merge' '
@@ -71,6 +73,7 @@ error: Your local changes to the following files would be overwritten by checkou
7173
rep/one
7274
rep/two
7375
Please, commit your changes or stash them before you can switch branches.
76+
Aborting
7477
EOF
7578

7679
test_expect_success 'cannot switch branches because of local changes' '
@@ -92,6 +95,7 @@ error: Your local changes to the following files would be overwritten by checkou
9295
rep/one
9396
rep/two
9497
Please, commit your changes or stash them before you can switch branches.
98+
Aborting
9599
EOF
96100

97101
test_expect_success 'not uptodate file porcelain checkout error' '
@@ -105,6 +109,7 @@ error: Updating the following directories would lose untracked files in it:
105109
rep
106110
rep2
107111
112+
Aborting
108113
EOF
109114

110115
test_expect_success 'not_uptodate_dir porcelain checkout error' '

unpack-trees.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static void display_error_msgs(struct unpack_trees_options *o)
159159
string_list_clear(rejects, 0);
160160
}
161161
if (something_displayed)
162-
printf("Aborting\n");
162+
fprintf(stderr, "Aborting\n");
163163
}
164164

165165
/*

0 commit comments

Comments
 (0)