git-send-pack: Fix --all option when used with directory
PATCH v2 1/1 git-send-pack: Fix --all option when used with directory
--- builtin/send-pack.c | 2 +- t/t5400-send-pack.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-)
builtin/send-pack.c +1 -1
@@ -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);
t/t5400-send-pack.sh +12 -0
@@ -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 && (
Signature · 1 line
2.7.4
Please ignore this thread, I sent the email without making sure that I copied commit message. I'm sorry for that.
Quoted 41 lines · Stanislav Kolotinskiy
--- builtin/send-pack.c | 2 +- t/t5400-send-pack.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-)builtin/send-pack.c +1
-1@@ -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);t/t5400-send-pack.sh +12
-0@@ -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 && (