summaryrefslogtreecommitdiff
path: root/send-pack.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2005-08-02 12:20:27 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2005-08-02 22:51:07 -0700
commit0bc3cdfc823e48069b778468196d8f5185a452cb (patch)
tree7c7d5aeeb257f002903b35762941ff05a53e38f6 /send-pack.c
parent[PATCH] list shortlog items in commit order (diff)
downloadtgif-0bc3cdfc823e48069b778468196d8f5185a452cb.tar.xz
Make send-pack --all and explicit ref mutually exclusive.
send-pack had a confusing misfeature that "send-pack --all master" updated all refs, while "send-pack --all" did not do anything. Make --all and explicit refs mutually exclusive, and make sure "send-pack --all" updates all refs. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'send-pack.c')
-rw-r--r--send-pack.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/send-pack.c b/send-pack.c
index 9b4be6130c..5a3aff6822 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -4,7 +4,8 @@
#include "pkt-line.h"
static const char send_pack_usage[] =
-"git-send-pack [--exec=git-receive-pack] [host:]directory [heads]*";
+"git-send-pack [--all] [--exec=git-receive-pack] <remote> [<head>...]\n"
+" --all and explicit <head> specification are mutually exclusive.";
static const char *exec = "git-receive-pack";
static int send_all = 0;
static int force_update = 0;
@@ -214,7 +215,7 @@ static int send_pack(int in, int out, int nr_match, char **match)
/*
* See if we have any refs that the other end didn't have
*/
- if (nr_match) {
+ if (nr_match || send_all) {
local_ref_nr_match = nr_match;
local_ref_match = match;
local_ref_list = ref_list;
@@ -281,6 +282,8 @@ int main(int argc, char **argv)
}
if (!dest)
usage(send_pack_usage);
+ if (heads && send_all)
+ usage(send_pack_usage);
pid = git_connect(fd, dest, exec);
if (pid < 0)
return 1;