summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7977f0e)
raw | patch | inline | side by side (parent: 7977f0e)
author | Dmitry V. Levin <ldv@altlinux.org> | |
Thu, 14 Sep 2006 01:04:09 +0000 (05:04 +0400) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 14 Sep 2006 18:48:11 +0000 (11:48 -0700) |
describe, git: Handle argc==0 case the same way as argc==1.
merge-tree: Refuse excessive arguments.
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
merge-tree: Refuse excessive arguments.
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
describe.c | patch | blob | history | |
git.c | patch | blob | history | |
merge-tree.c | patch | blob | history |
diff --git a/describe.c b/describe.c
index 5ed052d3a1ad68fe1f4bbc209da8e45ac5d28469..ab192f83ae27c5e0bf3f2a5f61684d0dc66deb32 100644 (file)
--- a/describe.c
+++ b/describe.c
setup_git_directory();
- if (i == argc)
+ if (argc <= i)
describe("HEAD", 1);
else
while (i < argc) {
index 47c85e10d16396734a44a05bf9cda079a894b803..8c182a5f5581d345e7bf69116f42fa3af089b2d5 100644 (file)
--- a/git.c
+++ b/git.c
int main(int argc, const char **argv, char **envp)
{
- const char *cmd = argv[0];
+ const char *cmd = argv[0] ? argv[0] : "git-help";
char *slash = strrchr(cmd, '/');
const char *exec_path = NULL;
int done_alias = 0;
diff --git a/merge-tree.c b/merge-tree.c
index c154dcfc0296879110a6adc3db849b5e6cee27cf..692ede0e3db7df66b2e5943dc58224f34c59fd8c 100644 (file)
--- a/merge-tree.c
+++ b/merge-tree.c
struct tree_desc t[3];
void *buf1, *buf2, *buf3;
- if (argc < 4)
+ if (argc != 4)
usage(merge_tree_usage);
setup_git_directory();