git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] http-push: Fix error message for push <remote> :<branch>
@ 2008-02-18 13:07 Clemens Buchacher
  2008-02-18 13:45 ` Johannes Schindelin
  0 siblings, 1 reply; 27+ messages in thread
From: Clemens Buchacher @ 2008-02-18 13:07 UTC (permalink / raw)
  To: git

git http-push <remote> :<branch> currently fails with the error message
"cannot happen anymore". Print a more useful error message instead.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
---

We should actually support this feature, of course. Unfortunately, a lot has
changed since the version of send-pack which http-push is based on
(v1.2.4-398-gaa1dbc9). I think http-push should be updated to reflect these
changes at a larger scope. Is there any work going on in this direction?

 http-push.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/http-push.c b/http-push.c
index f9b77d6..8de091f 100644
--- a/http-push.c
+++ b/http-push.c
@@ -2311,6 +2311,15 @@ int main(int argc, char **argv)
 
 		if (!ref->peer_ref)
 			continue;
+
+		if (is_zero_sha1(ref->peer_ref->new_sha1)) {
+			error("Deleting remote branches via :<branch> is not "
+				"currently supported by http-push. Use git "
+				"http-push -d <remote-url> <branch> instead.");
+			rc = -2;
+			continue;
+		}
+
 		if (!hashcmp(ref->old_sha1, ref->peer_ref->new_sha1)) {
 			if (push_verbosely || 1)
 				fprintf(stderr, "'%s': up-to-date\n", ref->name);
-- 
1.5.4.2.183.g1ae81

^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2008-02-27 22:25 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-18 13:07 [PATCH] http-push: Fix error message for push <remote> :<branch> Clemens Buchacher
2008-02-18 13:45 ` Johannes Schindelin
2008-02-18 15:55   ` [PATCH] http-push: push <remote> :<branch> deletes remote branch Clemens Buchacher
2008-02-18 16:44     ` Clemens Buchacher
2008-02-18 17:35       ` Johannes Schindelin
2008-02-18 17:34     ` Johannes Schindelin
2008-02-19 12:58       ` Clemens Buchacher
2008-02-19 13:17         ` Johannes Schindelin
2008-02-19 13:24           ` Mike Hommey
2008-02-19 13:31             ` Johannes Schindelin
2008-02-19 21:35               ` Junio C Hamano
2008-02-19 22:25                 ` Johannes Schindelin
2008-02-23 21:28       ` [PATCH] http-push: add regression tests Clemens Buchacher
2008-02-24  8:58         ` Mike Hommey
2008-02-24 18:03           ` Clemens Buchacher
2008-02-24 18:48             ` Mike Hommey
2008-02-24 19:14               ` Clemens Buchacher
2008-02-25 23:28               ` Clemens Buchacher
2008-02-26  0:24                 ` Junio C Hamano
2008-02-27  8:54                   ` Clemens Buchacher
2008-02-27  9:16                     ` Mike Hommey
2008-02-27  9:51                     ` Johannes Schindelin
2008-02-27 19:23                       ` Clemens Buchacher
2008-02-27 19:27                         ` [PATCH 1/2] http-push: push <remote> :<branch> deletes remote branch Clemens Buchacher
2008-02-27 19:28                         ` [PATCH 2/2] http-push: add regression tests Clemens Buchacher
2008-02-27 22:24                         ` [PATCH] " Johannes Schindelin
2008-02-26 19:32                 ` Mike Hommey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).