Documentation: clarify which parameters are optional to git-cherry
[gitweb.git] / git.c
diff --git a/git.c b/git.c
index 9e5813cc92ebcaad6485091a24903bf14427ec57..940a498962ceb06a1dba85547d61ad62bb81a499 100644 (file)
--- a/git.c
+++ b/git.c
@@ -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;