diff options
author | Jeff King <peff@peff.net> | 2014-07-09 17:45:43 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-07-10 10:53:00 -0700 |
commit | 37943e4c3867323593699d5458d2d7925fdf32fc (patch) | |
tree | 545d1e536a8268319adaf8f0f7ddcc8d83361b6a /merge-recursive.c | |
parent | Git 1.9.4 (diff) | |
download | tgif-37943e4c3867323593699d5458d2d7925fdf32fc.tar.xz |
remote-curl: do not complain on EOF from parent git
The parent git process is supposed to send us an empty line
to indicate that the conversation is over. However, the
parent process may die() if there is a problem with the
operation (e.g., we try to fetch a ref that does not exist).
In this case, it produces a useful message, but then
remote-curl _also_ produces an unhelpful message:
$ git pull origin matser
fatal: couldn't find remote ref matser
Unexpected end of command stream
The "right" way to fix this is to teach the parent git to
always cleanly close the connection to the helper, letting
it know that we are done. Implementing that is rather
clunky, though, as it would involve either replacing die()
operations with returning errors up the stack (until we
disconnect the transport), or adding an atexit handler to
clean up any transport helpers left open.
It's much simpler to just suppress the EOF message in
remote-curl. It was not added to address any real-world
situation in the first place, but rather a "we should
probably report unexpected things" suggestion[1].
It is the parent git which drives the operation, and whose
exit value actually matters. If the parent dies, then the
helper has no need to complain (except as a debugging aid).
In the off chance that the pipe is closed without the parent
dying, it can still notice the non-zero exit code.
[1] http://article.gmane.org/gmane.comp.version-control.git/176036
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-recursive.c')
0 files changed, 0 insertions, 0 deletions