summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4232826)
raw | patch | inline | side by side (parent: 4232826)
author | Tay Ray Chuan <rctay89@gmail.com> | |
Fri, 8 Jan 2010 02:12:44 +0000 (10:12 +0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 10 Jan 2010 07:34:10 +0000 (23:34 -0800) |
If the status of a ref is REF_STATUS_NONE, the remote helper will not
be told to push the ref (via a 'push' command).
However, the remote helper may still act on these refs.
If the helper does act on the ref, and prints a status for it, ignore
the report (ie. don't overwrite the status of the ref with it, nor the
message in the remote_status member) if the reported status is 'no
match'.
This allows the user to be alerted to more "interesting" ref statuses,
like REF_STATUS_NONFASTFORWARD.
Cc: Jeff King <peff@peff.net>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
be told to push the ref (via a 'push' command).
However, the remote helper may still act on these refs.
If the helper does act on the ref, and prints a status for it, ignore
the report (ie. don't overwrite the status of the ref with it, nor the
message in the remote_status member) if the reported status is 'no
match'.
This allows the user to be alerted to more "interesting" ref statuses,
like REF_STATUS_NONFASTFORWARD.
Cc: Jeff King <peff@peff.net>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5541-http-push.sh | patch | blob | history | |
transport-helper.c | patch | blob | history |
diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh
index 979624d0dc7a2973919b55ba6fe462dde34f3952..83a8e14c6c385d6d6fbdd179d30018128e8a200f 100755 (executable)
--- a/t/t5541-http-push.sh
+++ b/t/t5541-http-push.sh
section of '"'git push --help'"' for details." output
'
-test_expect_failure 'push fails for non-fast-forward refs unmatched by remote helper' '
+test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper' '
# create a dissimilarly-named remote ref so that git is unable to match the
# two refs (viz. local, remote) unless an explicit refspec is provided.
git push origin master:retsam
diff --git a/transport-helper.c b/transport-helper.c
index 7c9b569d9488aa9dc779a1587acf940f4ef0dc5a..71a1e50ee712dfeedd0928afc22fbc0e6f855d73 100644 (file)
--- a/transport-helper.c
+++ b/transport-helper.c
continue;
}
+ if (ref->status != REF_STATUS_NONE) {
+ /*
+ * Earlier, the ref was marked not to be pushed, so ignore the ref
+ * status reported by the remote helper if the latter is 'no match'.
+ */
+ if (status == REF_STATUS_NONE)
+ continue;
+ }
+
ref->status = status;
ref->remote_status = msg;
}