Skip to content

Commit 18c554b

Browse files
committed
Merge branch 'sk/send-pack-all-fix' into maint
"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
2 parents b96c396 + c677756 commit 18c554b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

builtin/send-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
225225
* --all and --mirror are incompatible; neither makes sense
226226
* with any refspecs.
227227
*/
228-
if ((refspecs && (send_all || args.send_mirror)) ||
228+
if ((nr_refspecs > 0 && (send_all || args.send_mirror)) ||
229229
(send_all && args.send_mirror))
230230
usage_with_options(send_pack_usage, options);
231231

t/t5400-send-pack.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,18 @@ test_expect_success 'denyNonFastforwards trumps --force' '
128128
test "$victim_orig" = "$victim_head"
129129
'
130130

131+
test_expect_success 'send-pack --all sends all branches' '
132+
# make sure we have at least 2 branches with different
133+
# values, just to be thorough
134+
git branch other-branch HEAD^ &&
135+
136+
git init --bare all.git &&
137+
git send-pack --all all.git &&
138+
git for-each-ref refs/heads >expect &&
139+
git -C all.git for-each-ref refs/heads >actual &&
140+
test_cmp expect actual
141+
'
142+
131143
test_expect_success 'push --all excludes remote-tracking hierarchy' '
132144
mkdir parent &&
133145
(

0 commit comments

Comments
 (0)