summaryrefslogtreecommitdiff
path: root/builtin-send-pack.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2008-07-08 00:08:02 -0400
committerJunio C Hamano <gitster@pobox.com>2008-07-08 13:05:11 -0700
commit0b294c0abf00a9cf7468e0ea62722ae23b0816cc (patch)
tree5e424be8dc66b52a104328ee212347aa58811db5 /builtin-send-pack.c
parent30161e73d17f309f9a7566459035b06ec748be7d (diff)
downloadgit-0b294c0abf00a9cf7468e0ea62722ae23b0816cc.tar.gz
make deleting a missing ref more quiet
If git attempts to delete a ref, but the unlink of the ref file fails, we print a message to stderr. This is usually a good thing, but if the error is ENOENT, then it indicates that the ref has _already_ been deleted. And since that's our goal, it doesn't make sense to complain to the user. This harmonizes the error reporting behavior for the unpacked and packed cases; the packed case already printed nothing on ENOENT, but the unpacked printed unconditionally. Additionally, send-pack would, when deleting the tracking ref corresponding to a remote delete, print "Failed to delete" on any failure. This can be a misleading message, since we actually _did_ delete at the remote side, but we failed to delete locally. Rather than make the message more precise, let's just eliminate it entirely; the delete_ref routine already takes care of printing out a much more specific message about what went wrong. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-send-pack.c')
-rw-r--r--builtin-send-pack.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin-send-pack.c b/builtin-send-pack.c
index d76260c09e..a708d0af48 100644
--- a/builtin-send-pack.c
+++ b/builtin-send-pack.c
@@ -226,8 +226,7 @@ static void update_tracking_ref(struct remote *remote, struct ref *ref)
if (args.verbose)
fprintf(stderr, "updating local tracking ref '%s'\n", rs.dst);
if (ref->deletion) {
- if (delete_ref(rs.dst, NULL))
- error("Failed to delete");
+ delete_ref(rs.dst, NULL);
} else
update_ref("update by push", rs.dst,
ref->new_sha1, NULL, 0, 0);