summaryrefslogtreecommitdiffstats
path: root/src/hook.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hook.c')
-rw-r--r--src/hook.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/hook.c b/src/hook.c
index ffad0bf..1dc4445 100644
--- a/src/hook.c
+++ b/src/hook.c
@@ -190,7 +190,7 @@ static char *derive_repo(hook_opts o)
return xstrdup("");
root = getenv("GIT_REPO_ROOT");
if (root == NULL || root[0] == '\0')
- root = "/var/lib/git";
+ root = DEFAULT_ROOT; // the documented home of the repositories
rootlen = strlen(root);
while (rootlen > 1 && root[rootlen - 1] == '/')
rootlen--; // "/var/lib/git/" is "/var/lib/git"
@@ -262,20 +262,17 @@ static int parse_options(int argc, char **argv, hook_opts *o)
case OPT_NOGIT: o->use_git = 0; break;
case OPT_EXPLAIN: o->explain = 1; break;
case ':':
- fprintf(stderr, "%s: --%s wants a value\n", progname,
- authz_optname(optopt, longopts));
+ authz_opt_need_value(longopts);
return -1;
default:
// getopt_long gives back no name for an option it does not know,
// but optind has already stepped past it.
- fprintf(stderr, "%s: authorize: unknown argument %s\n", progname,
- argv[optind - 1]);
+ authz_opt_unknown("authorize", argv[optind - 1]);
return -1;
}
}
if (optind < argc) {
- fprintf(stderr, "%s: authorize: unknown argument %s\n", progname,
- argv[optind]);
+ authz_opt_unknown("authorize", argv[optind]);
return -1;
}
return 0;