Merge branch 'dp/remove-duplicated-header-inclusion'
authorJunio C Hamano <gitster@pobox.com>
Wed, 25 Feb 2015 23:40:14 +0000 (15:40 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 25 Feb 2015 23:40:14 +0000 (15:40 -0800)
Code clean-up.

* dp/remove-duplicated-header-inclusion:
do not include the same header twice

1  2 
transport-helper.c
diff --combined transport-helper.c
index 7441d5d515fa6a74b60b04b312f9bc4e83f4b462,3652b164c3b87330ae074dacc8ee8e25c518ed60..7dc4a443aee0c6220dc0581d4bcfdd1d65da1d8a
@@@ -5,7 -5,6 +5,6 @@@
  #include "commit.h"
  #include "diff.h"
  #include "revision.h"
- #include "quote.h"
  #include "remote.h"
  #include "string-list.h"
  #include "thread-utils.h"
@@@ -356,8 -355,7 +355,8 @@@ static int fetch_with_fetch(struct tran
                        continue;
  
                strbuf_addf(&buf, "fetch %s %s\n",
 -                          sha1_to_hex(posn->old_sha1), posn->name);
 +                          sha1_to_hex(posn->old_sha1),
 +                          posn->symref ? posn->symref : posn->name);
        }
  
        strbuf_addch(&buf, '\n');
@@@ -455,8 -453,7 +454,8 @@@ static int fetch_with_import(struct tra
                if (posn->status & REF_STATUS_UPTODATE)
                        continue;
  
 -              strbuf_addf(&buf, "import %s\n", posn->name);
 +              strbuf_addf(&buf, "import %s\n",
 +                          posn->symref ? posn->symref : posn->name);
                sendline(data, &buf);
                strbuf_reset(&buf);
        }
         * fast-forward or this is a forced update.
         */
        for (i = 0; i < nr_heads; i++) {
 -              char *private;
 +              char *private, *name;
                posn = to_fetch[i];
                if (posn->status & REF_STATUS_UPTODATE)
                        continue;
 +              name = posn->symref ? posn->symref : posn->name;
                if (data->refspecs)
 -                      private = apply_refspecs(data->refspecs, data->refspec_nr, posn->name);
 +                      private = apply_refspecs(data->refspecs, data->refspec_nr, name);
                else
 -                      private = xstrdup(posn->name);
 +                      private = xstrdup(name);
                if (private) {
                        read_ref(private, posn->old_sha1);
                        free(private);
@@@ -863,7 -859,7 +862,7 @@@ static int push_refs_with_export(struc
                        die("helper %s does not support dry-run", data->name);
        } else if (flags & TRANSPORT_PUSH_CERT) {
                if (set_helper_option(transport, TRANS_OPT_PUSH_CERT, "true") != 0)
 -                      die("helper %s does not support dry-run", data->name);
 +                      die("helper %s does not support --signed", data->name);
        }
  
        if (flags & TRANSPORT_PUSH_FORCE) {