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
This commit is contained in:
18
git.c
18
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" );
|
||||
|
Reference in New Issue
Block a user