Skip to content

Commit 266f1fd

Browse files
peffgitster
authored andcommitted
transport-helper: be quiet on read errors from helpers
Prior to commit 81d340d, we did not print any error message if a remote transport helper died unexpectedly. If a helper did not print any error message (e.g., because it crashed), the user could be left confused. That commit tried to rectify the situation by printing a note that the helper exited unexpectedly. However, this makes a much more common case worse: when a helper does die with a useful message, we print the extra "Reading from 'git-remote-foo failed" message. This can also end up confusing users, as they may not even know what remote helpers are (e.g., the fact that http support comes through git-remote-https is purely an implementation detail that most users do not know or care about). Since we do not have a good way of knowing whether the helper printed a useful error, and since the common failure mode is for it to do so, let's default to remaining quiet. Debuggers can dig further by setting GIT_TRANSPORT_HELPER_DEBUG. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 21ff915 commit 266f1fd

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

t/t5801-remote-helpers.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,7 @@ test_expect_success 'proper failure checks for pushing' '
210210
(GIT_REMOTE_TESTGIT_FAILURE=1 &&
211211
export GIT_REMOTE_TESTGIT_FAILURE &&
212212
cd local &&
213-
test_must_fail git push --all 2> error &&
214-
cat error &&
215-
grep -q "Reading from helper .git-remote-testgit. failed" error
213+
test_must_fail git push --all
216214
)
217215
'
218216

transport-helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static int recvline_fh(FILE *helper, struct strbuf *buffer, const char *name)
5656
if (strbuf_getline(buffer, helper, '\n') == EOF) {
5757
if (debug)
5858
fprintf(stderr, "Debug: Remote helper quit.\n");
59-
die("Reading from helper 'git-remote-%s' failed", name);
59+
exit(128);
6060
}
6161

6262
if (debug)

0 commit comments

Comments
 (0)