diff options
-rw-r--r-- | git.c | 4 | ||||
-rw-r--r-- | setup.c | 3 |
2 files changed, 4 insertions, 3 deletions
@@ -195,8 +195,8 @@ static int handle_alias(int *argcp, const char ***argv) ret = 1; } - if (subdir) - chdir(subdir); + if (subdir && chdir(subdir)) + die("Cannot change to %s: %s", subdir, strerror(errno)); errno = saved_errno; @@ -470,7 +470,8 @@ const char *setup_git_directory_gently(int *nongit_ok) } die("Not a git repository"); } - chdir(".."); + if (chdir("..")) + die("Cannot change to %s/..: %s", cwd, strerror(errno)); } inside_git_dir = 0; |