summaryrefslogtreecommitdiff
path: root/transport-helper.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-06-06 12:17:22 -0700
committerJunio C Hamano <gitster@pobox.com>2013-06-06 12:17:22 -0700
commit99d9ec090677c925c534001f01cbaf303a31cb82 (patch)
treed171c279c00aaced94ab6ee81885a874eedda564 /transport-helper.c
parentecb9f3e73366d020dc97f60c7529c3703aa778e0 (diff)
parent21457f5719b894a5997d66ff098b375bc2404260 (diff)
downloadgit-99d9ec090677c925c534001f01cbaf303a31cb82.tar.gz
Merge branch 'fc/transport-helper-no-refspec'
With "export" remote-helper protocol, (1) a push that tries to update a remote ref whose name is different from the pushing side does not work yet, and (2) the helper may not know how to do --dry-run Detect such problematic cases and disable them for now. * fc/transport-helper-no-refspec: transport-helper: check if the dry-run is supported transport-helper: barf when user tries old:new
Diffstat (limited to 'transport-helper.c')
-rw-r--r--transport-helper.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/transport-helper.c b/transport-helper.c
index 2f5ac3fbee..06c08a1786 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -809,6 +809,11 @@ static int push_refs_with_export(struct transport *transport,
if (!data->refspecs)
die("remote-helper doesn't support push; refspec needed");
+ if (flags & TRANSPORT_PUSH_DRY_RUN) {
+ if (set_helper_option(transport, "dry-run", "true") != 0)
+ die("helper %s does not support dry-run", data->name);
+ }
+
helper = get_helper(transport);
write_constant(helper->in, "export\n");
@@ -830,8 +835,14 @@ static int push_refs_with_export(struct transport *transport,
}
free(private);
- if (ref->peer_ref)
+ if (ref->deletion)
+ die("remote-helpers do not support ref deletion");
+
+ if (ref->peer_ref) {
+ if (strcmp(ref->peer_ref->name, ref->name))
+ die("remote-helpers do not support old:new syntax");
string_list_append(&revlist_args, ref->peer_ref->name);
+ }
}
if (get_exporter(transport, &exporter, &revlist_args))