summaryrefslogtreecommitdiff
path: root/t/t5400-send-pack.sh
diff options
context:
space:
mode:
authorStanislav Kolotinskiy <stanislav@assembla.com>2016-03-31 13:55:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-03-31 21:58:26 (GMT)
commitc6777563cd2b3e1d1989732c3daf05a72fddb068 (patch)
tree28a0b6564a1bdc68ffa112714ea5bf4358c87e47 /t/t5400-send-pack.sh
parent68c757f2199911005918aba45aa8ae0fecc72074 (diff)
downloadgit-c6777563cd2b3e1d1989732c3daf05a72fddb068.zip
git-c6777563cd2b3e1d1989732c3daf05a72fddb068.tar.gz
git-c6777563cd2b3e1d1989732c3daf05a72fddb068.tar.bz2
git-send-pack: fix --all option when used with directory
When using git send-pack with --all option and a target repository specification ([<host>:]<directory>), usage message is being displayed instead of performing the actual transmission. The reason for this issue is that destination and refspecs are being set in the same conditional and are populated from argv. When a target repository is passed, refspecs is being populated as well with its value. This makes the check for refspecs not being NULL to always return true, which, in conjunction with the check for --all or --mirror options, is always true as well and returns usage message instead of proceeding. This ensures that send-pack will stop execution only when --all or --mirror switch is used in conjunction with any refspecs passed. Signed-off-by: Stanislav Kolotinskiy <stanislav@assembla.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5400-send-pack.sh')
-rwxr-xr-xt/t5400-send-pack.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh
index 04cea97..305ca7a 100755
--- a/t/t5400-send-pack.sh
+++ b/t/t5400-send-pack.sh
@@ -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 &&
(