summaryrefslogtreecommitdiff
path: root/send-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-03-27 17:59:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-03-27 17:59:27 (GMT)
commit4e87565d2a3e315b7afc39e9e1fe98c5607a1b11 (patch)
tree6f268f4c98d8c9a06536a5a2fbea5ee9a7df83fc /send-pack.c
parent4a2b50a1e3667ee40bf08726fb249b634e9df1b6 (diff)
parent511155db51ff9870d2b3fd74c6dfdd558b5fa37b (diff)
downloadgit-4e87565d2a3e315b7afc39e9e1fe98c5607a1b11.zip
git-4e87565d2a3e315b7afc39e9e1fe98c5607a1b11.tar.gz
git-4e87565d2a3e315b7afc39e9e1fe98c5607a1b11.tar.bz2
Merge branch 'sb/push-options-via-transport'
Recently we started passing the "--push-options" through the external remote helper interface; now the "smart HTTP" remote helper understands what to do with the passed information. * sb/push-options-via-transport: remote-curl: allow push options send-pack: send push options correctly in stateless-rpc case
Diffstat (limited to 'send-pack.c')
-rw-r--r--send-pack.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/send-pack.c b/send-pack.c
index d2d2a49..66e652f 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -532,6 +532,14 @@ int send_pack(struct send_pack_args *args,
}
}
+ if (use_push_options) {
+ struct string_list_item *item;
+
+ packet_buf_flush(&req_buf);
+ for_each_string_list_item(item, args->push_options)
+ packet_buf_write(&req_buf, "%s", item->string);
+ }
+
if (args->stateless_rpc) {
if (!args->dry_run && (cmds_sent || is_repository_shallow())) {
packet_buf_flush(&req_buf);
@@ -544,18 +552,6 @@ int send_pack(struct send_pack_args *args,
strbuf_release(&req_buf);
strbuf_release(&cap_buf);
- if (use_push_options) {
- struct string_list_item *item;
- struct strbuf sb = STRBUF_INIT;
-
- for_each_string_list_item(item, args->push_options)
- packet_buf_write(&sb, "%s", item->string);
-
- write_or_die(out, sb.buf, sb.len);
- packet_flush(out);
- strbuf_release(&sb);
- }
-
if (use_sideband && cmds_sent) {
memset(&demux, 0, sizeof(demux));
demux.proc = sideband_demux;