Make chdir failures visible

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Alex Riesen
2008-12-05 01:36:46 +01:00
committed by Junio C Hamano
parent 47d32af233
commit 7be77de266
2 changed files with 4 additions and 3 deletions

4
git.c
View File

@ -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;