aboutsummaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-08-17 17:35:38 -0700
committerJunio C Hamano <gitster@pobox.com>2011-08-17 17:35:38 -0700
commit6ed547b53b90bebd2371b086b83b416b22b243b2 (patch)
treed0b9cf755a58c5b9f6f460936e240bb44dd6274a /git.c
parent6dd5622f68157f471c4f784e8c41f39e8c5163fc (diff)
parentbf7930caa0da2fbd6def59a54608ac494c272197 (diff)
downloadgit-6ed547b53b90bebd2371b086b83b416b22b243b2.tar.gz
git-6ed547b53b90bebd2371b086b83b416b22b243b2.tar.xz
Merge branch 'js/ref-namespaces'
* js/ref-namespaces: ref namespaces: tests ref namespaces: documentation ref namespaces: Support remote repositories via upload-pack and receive-pack ref namespaces: infrastructure Fix prefix handling in ref iteration functions
Diffstat (limited to 'git.c')
-rw-r--r--git.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/git.c b/git.c
index 8828c18d6..304522b53 100644
--- a/git.c
+++ b/git.c
@@ -7,8 +7,8 @@
const char git_usage_string[] =
"git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
- " [-p|--paginate|--no-pager] [--no-replace-objects]\n"
- " [--bare] [--git-dir=<path>] [--work-tree=<path>]\n"
+ " [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]\n"
+ " [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
" [-c name=value] [--help]\n"
" <command> [<args>]";
@@ -126,6 +126,20 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
setenv(GIT_DIR_ENVIRONMENT, cmd + 10, 1);
if (envchanged)
*envchanged = 1;
+ } else if (!strcmp(cmd, "--namespace")) {
+ if (*argc < 2) {
+ fprintf(stderr, "No namespace given for --namespace.\n" );
+ usage(git_usage_string);
+ }
+ setenv(GIT_NAMESPACE_ENVIRONMENT, (*argv)[1], 1);
+ if (envchanged)
+ *envchanged = 1;
+ (*argv)++;
+ (*argc)--;
+ } else if (!prefixcmp(cmd, "--namespace=")) {
+ setenv(GIT_NAMESPACE_ENVIRONMENT, cmd + 12, 1);
+ if (envchanged)
+ *envchanged = 1;
} else if (!strcmp(cmd, "--work-tree")) {
if (*argc < 2) {
fprintf(stderr, "No directory given for --work-tree.\n" );