Merge branch 'sk/send-pack-all-fix' into maint
authorJunio C Hamano <gitster@pobox.com>
Fri, 29 Apr 2016 21:15:56 +0000 (14:15 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 29 Apr 2016 21:15:57 +0000 (14:15 -0700)
"git send-pack --all <there>" was broken when its command line
option parsing was written in the 2.6 timeframe.

* sk/send-pack-all-fix:
git-send-pack: fix --all option when used with directory

1  2 
builtin/send-pack.c
diff --combined builtin/send-pack.c
index 5b9dd6a9d8ebe888c2fc912af3590b92737e7a99,19f0577fa0af2e9e7b43fa074dba14694d0c125f..1ff5a6753803f8c2ccb5e66dcb926582bd25fd37
@@@ -212,7 -212,7 +212,7 @@@ int cmd_send_pack(int argc, const char 
                                argv_array_push(&all_refspecs, buf);
                } else {
                        struct strbuf line = STRBUF_INIT;
 -                      while (strbuf_getline(&line, stdin, '\n') != EOF)
 +                      while (strbuf_getline(&line, stdin) != EOF)
                                argv_array_push(&all_refspecs, line.buf);
                        strbuf_release(&line);
                }
         * --all and --mirror are incompatible; neither makes sense
         * with any refspecs.
         */
-       if ((refspecs && (send_all || args.send_mirror)) ||
+       if ((nr_refspecs > 0 && (send_all || args.send_mirror)) ||
            (send_all && args.send_mirror))
                usage_with_options(send_pack_usage, options);