summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2db511f)
raw | patch | inline | side by side (parent: 2db511f)
author | Clemens Buchacher <drizzd@aon.at> | |
Wed, 27 Feb 2008 19:27:53 +0000 (20:27 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 27 Feb 2008 23:38:24 +0000 (15:38 -0800) |
This mirrors current ssh/git push syntax.
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http-push.c | patch | blob | history |
diff --git a/http-push.c b/http-push.c
index 0beb7406c34a19403062a6a2e2aeeee35566a45f..4b31070eb9df029a2d57e976129560b76ab3660a 100644 (file)
--- a/http-push.c
+++ b/http-push.c
/* Send delete request */
fprintf(stderr, "Removing remote branch '%s'\n", remote_ref->name);
+ if (dry_run)
+ return 0;
url = xmalloc(strlen(remote->url) + strlen(remote_ref->name) + 1);
sprintf(url, "%s%s", remote->url, remote_ref->name);
slot = get_active_slot();
if (!ref->peer_ref)
continue;
+
+ if (is_zero_sha1(ref->peer_ref->new_sha1)) {
+ if (delete_remote_branch(ref->name, 1) == -1) {
+ error("Could not remove %s", ref->name);
+ rc = -4;
+ }
+ new_refs++;
+ continue;
+ }
+
if (!hashcmp(ref->old_sha1, ref->peer_ref->new_sha1)) {
if (push_verbosely || 1)
fprintf(stderr, "'%s': up-to-date\n", ref->name);
}
}
hashcpy(ref->new_sha1, ref->peer_ref->new_sha1);
- if (is_zero_sha1(ref->new_sha1)) {
- error("cannot happen anymore");
- rc = -3;
- continue;
- }
new_refs++;
strcpy(old_hex, sha1_to_hex(ref->old_sha1));
new_hex = sha1_to_hex(ref->new_sha1);