if (!gitdirenv) {
int len, offset;
- if (!getcwd(cwd, sizeof(cwd)-1) || cwd[0] != '/')
+ if (!getcwd(cwd, sizeof(cwd)-1))
die("Unable to read current working directory");
offset = len = strlen(cwd);
die("Not a git repository: '%s'", gitdirenv);
}
- if (!getcwd(cwd, sizeof(cwd)-1) || cwd[0] != '/')
+ if (!getcwd(cwd, sizeof(cwd)-1))
die("Unable to read current working directory");
if (chdir(gitdirenv)) {
if (nongit_ok) {
die("Cannot change directory to $%s '%s'",
GIT_DIR_ENVIRONMENT, gitdirenv);
}
- if (!getcwd(gitdir, sizeof(gitdir)-1) || gitdir[0] != '/')
+ if (!getcwd(gitdir, sizeof(gitdir)-1))
die("Unable to read current working directory");
if (chdir(cwd))
die("Cannot come back to cwd");
die("Cannot change directory to working tree '%s'",
gitworktree);
}
- if (!getcwd(worktree, sizeof(worktree)-1) || worktree[0] != '/')
+ if (!getcwd(worktree, sizeof(worktree)-1))
die("Unable to read current working directory");
strcat(worktree, "/");
inside_work_tree = !prefixcmp(cwd, worktree);
int git_config_perm(const char *var, const char *value)
{
if (value) {
+ int i;
if (!strcmp(value, "umask"))
return PERM_UMASK;
if (!strcmp(value, "group"))
!strcmp(value, "world") ||
!strcmp(value, "everybody"))
return PERM_EVERYBODY;
+ i = atoi(value);
+ if (i > 1)
+ return i;
}
return git_config_bool(var, value);
}