summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f15f736)
raw | patch | inline | side by side (parent: f15f736)
author | Rene Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Fri, 25 Jul 2008 10:41:25 +0000 (12:41 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 26 Jul 2008 00:28:40 +0000 (17:28 -0700) |
Allow "--remote repo" and "--exec cmd" in addition to "--remote=repo" and
"--exec=cmd" to make their usage consistent with parameters handled by
parse_options().
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
"--exec=cmd" to make their usage consistent with parameters handled by
parse_options().
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-archive.c | patch | blob | history |
diff --git a/builtin-archive.c b/builtin-archive.c
index 4dd2716c0f8cd41425ecc51f85a7dbdd0511c41b..22445acbfc5279f391ac6afa855b21064ec54535 100644 (file)
--- a/builtin-archive.c
+++ b/builtin-archive.c
int fd[2], i, len, rv;
struct child_process *conn;
const char *exec = "git-upload-archive";
- int exec_at = 0;
+ int exec_at = 0, exec_value_at = 0;
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
die("multiple --exec specified");
exec = arg + 7;
exec_at = i;
- break;
+ } else if (!strcmp(arg, "--exec")) {
+ if (exec_at)
+ die("multiple --exec specified");
+ if (i + 1 >= argc)
+ die("option --exec requires a value");
+ exec = argv[i + 1];
+ exec_at = i;
+ exec_value_at = ++i;
}
}
conn = git_connect(fd, url, exec, 0);
for (i = 1; i < argc; i++) {
- if (i == exec_at)
+ if (i == exec_at || i == exec_value_at)
continue;
packet_write(fd[1], "argument %s\n", argv[i]);
}
die("Multiple --remote specified");
remote = arg + 9;
continue;
+ } else if (!strcmp(arg, "--remote")) {
+ if (remote)
+ die("Multiple --remote specified");
+ if (++ix >= cnt)
+ die("option --remote requires a value");
+ remote = av[ix];
+ continue;
}
if (arg[0] != '-')
no_more_options = 1;