summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2a0fe89)
raw | patch | inline | side by side (parent: 2a0fe89)
author | Jeff King <peff@peff.net> | |
Sun, 18 Nov 2007 08:08:22 +0000 (03:08 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 18 Nov 2007 10:35:39 +0000 (02:35 -0800) |
This has always been slightly inaccurate, since it used the
new_refs counter, which really meant "did we send any
objects," so deletions were not counted.
It has gotten even worse with recent patches, since we no
longer look at the 'ret' value, meaning we would say "up to
date" if non-ff pushes were rejected.
Instead, we now claim up to date iff every ref is either
unmatched or up to date. Any other case should already have
generated a status line.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
new_refs counter, which really meant "did we send any
objects," so deletions were not counted.
It has gotten even worse with recent patches, since we no
longer look at the 'ret' value, meaning we would say "up to
date" if non-ff pushes were rejected.
Instead, we now claim up to date iff every ref is either
unmatched or up to date. Any other case should already have
generated a status line.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-send-pack.c | patch | blob | history |
diff --git a/builtin-send-pack.c b/builtin-send-pack.c
index 14447bb7cd301bd693273734ce6b291f11bfcef6..3aab89ca1bb9202232448f16e44e939bff4c820d 100644 (file)
--- a/builtin-send-pack.c
+++ b/builtin-send-pack.c
}
}
+static int refs_pushed(struct ref *ref)
+{
+ for (; ref; ref = ref->next) {
+ switch(ref->status) {
+ case REF_STATUS_NONE:
+ case REF_STATUS_UPTODATE:
+ break;
+ default:
+ return 1;
+ }
+ }
+ return 0;
+}
+
static int do_send_pack(int in, int out, struct remote *remote, const char *dest, int nr_refspec, const char **refspec)
{
struct ref *ref;
@@ -487,7 +501,7 @@ static int do_send_pack(int in, int out, struct remote *remote, const char *dest
update_tracking_ref(remote, ref);
}
- if (!new_refs)
+ if (!refs_pushed(remote_refs))
fprintf(stderr, "Everything up-to-date\n");
if (ret < 0)
return ret;