That's possible, but I think we currently only care about per-ref stuff
for whether we actually did a push to that ref, and we care about whether
we had a failure that affects all refs, and we care (for the return value)
whether we have any errors at all.
I think it's actually very significant what commits made locally have
or haven't been made public.
How about this, in addition to my previous dropping peer_ref:
diff --git a/builtin-send-pack.c b/builtin-send-pack.c
index 947c42b..1b7206c 100644
--- a/builtin-send-pack.c
+++ b/builtin-send-pack.c
@@ -337,8 +343,10 @@ static int do_send_pack(int in, int out, struct remote *remote, int nr_refspec,
}
packet_flush(out);
- if (new_refs && !args.dry_run)
- ret = pack_objects(out, remote_refs);
+ if (new_refs && !args.dry_run) {
+ if (pack_objects(out, remote_refs))
+ ret = -4;
+ }
close(out);
if (expect_status_report) {
@@ -346,7 +354,7 @@ static int do_send_pack(int in, int out, struct remote *remote, int nr_refspec,
ret = -4;
}
- if (!args.dry_run && remote && ret == 0) {
+ if (!args.dry_run && remote && ret != -4) {
for (ref = remote_refs; ref; ref = ref->next)
update_tracking_ref(remote, ref);
}
That is, -2 means that we've done less than was asked, but nothing blew
up; -4 means something blew up. When we skip something, we drop peer_ref
from it, so there's nothing to update (and it's dropped from the set of
mappings, in case we cared further about it with respect to reporting the
actions we actually took). Then we update all refs that were acted on if
ret isn't -4, and we return non-zero if ret is either -2 or -4.
-Daniel
*This .sig left intentionally blank*
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html