summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 616f86d)
raw | patch | inline | side by side (parent: 616f86d)
author | Jonathan Nieder <jrnieder@gmail.com> | |
Mon, 9 Nov 2009 10:47:34 +0000 (04:47 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 10 Nov 2009 19:59:51 +0000 (11:59 -0800) |
http-push already knows how to dump usage if it is given no options, but
it interprets '-h' as the URL to a remote repository:
$ git http-push -h
error: Cannot access URL -h/, return code 6
Dump usage instead. Humans wanting to pass the URL -h/ to curl for some
reason can use 'git http-push -h/' explicitly. Scripts expecting to
access an HTTP repository at URL '-h' will break, though.
Also delay finding a git directory until after option parsing, so
"http-push -h" can be used outside any git repository.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
it interprets '-h' as the URL to a remote repository:
$ git http-push -h
error: Cannot access URL -h/, return code 6
Dump usage instead. Humans wanting to pass the URL -h/ to curl for some
reason can use 'git http-push -h/' explicitly. Scripts expecting to
access an HTTP repository at URL '-h' will break, though.
Also delay finding a git directory until after option parsing, so
"http-push -h" can be used outside any git repository.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http-push.c | patch | blob | history |
diff --git a/http-push.c b/http-push.c
index 00e83dcec1d973b069d4c75105aed96634b00994..ad1a6c90967b36365563de210ec2d066ae9d979a 100644 (file)
--- a/http-push.c
+++ b/http-push.c
git_extract_argv0_path(argv[0]);
- setup_git_directory();
-
repo = xcalloc(sizeof(*repo), 1);
argv++;
force_delete = 1;
continue;
}
+ if (!strcmp(arg, "-h"))
+ usage(http_push_usage);
}
if (!repo->url) {
char *path = strstr(arg, "//");
if (delete_branch && nr_refspec != 1)
die("You must specify only one branch name when deleting a remote branch");
+ setup_git_directory();
+
memset(remote_dir_exists, -1, 256);
/*