Skip to content

Commit

Permalink
unpack-trees: print "Aborting" to stderr
Browse files Browse the repository at this point in the history
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 <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael J Gruber authored and Junio C Hamano committed Sep 21, 2011
1 parent f696543 commit 6f90969
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions t/t7607-merge-overwrite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ error: The following untracked working tree files would be overwritten by merge:
sub
sub2
Please move or remove them before you can merge.
Aborting
EOF

test_expect_success 'will not overwrite untracked file in leading path' '
Expand Down
5 changes: 5 additions & 0 deletions t/t7609-merge-co-error-msgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ error: The following untracked working tree files would be overwritten by merge:
three
two
Please move or remove them before you can merge.
Aborting
EOF

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

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

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

test_expect_success 'not uptodate file porcelain checkout error' '
Expand All @@ -105,6 +109,7 @@ error: Updating the following directories would lose untracked files in it:
rep
rep2
Aborting
EOF

test_expect_success 'not_uptodate_dir porcelain checkout error' '
Expand Down
2 changes: 1 addition & 1 deletion unpack-trees.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static void display_error_msgs(struct unpack_trees_options *o)
string_list_clear(rejects, 0);
}
if (something_displayed)
printf("Aborting\n");
fprintf(stderr, "Aborting\n");
}

/*
Expand Down

0 comments on commit 6f90969

Please sign in to comment.