1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-27 02:56:12 +02:00

Merge branch 'sk/send-pack-all-fix'

"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
This commit is contained in:
Junio C Hamano 2016-04-13 14:12:33 -07:00
commit 5250af49f0
2 changed files with 13 additions and 1 deletions

View File

@ -225,7 +225,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
* --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);

View File

@ -128,6 +128,18 @@ test_expect_success 'denyNonFastforwards trumps --force' '
test "$victim_orig" = "$victim_head"
'
test_expect_success 'send-pack --all sends all branches' '
# make sure we have at least 2 branches with different
# values, just to be thorough
git branch other-branch HEAD^ &&
git init --bare all.git &&
git send-pack --all all.git &&
git for-each-ref refs/heads >expect &&
git -C all.git for-each-ref refs/heads >actual &&
test_cmp expect actual
'
test_expect_success 'push --all excludes remote-tracking hierarchy' '
mkdir parent &&
(