summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f0ef059)
raw | patch | inline | side by side (parent: f0ef059)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Wed, 28 Jun 2006 10:45:27 +0000 (12:45 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 28 Jun 2006 10:55:36 +0000 (03:55 -0700) |
git.c:main() relies on the value of errno being set by the last attempt to
execute the command. However, if something goes awry in handle_alias(),
that assumption is wrong. So restore errno before returning from
handle_alias().
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
execute the command. However, if something goes awry in handle_alias(),
that assumption is wrong. So restore errno before returning from
handle_alias().
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git.c | patch | blob | history |
index 159fec008b55932c67f2a2ce2b5c112ead959b96..ca8961f0732bacc4efdb3afe9abc2e829ff69ee5 100644 (file)
--- a/git.c
+++ b/git.c
static int handle_alias(int *argcp, const char ***argv)
{
- int nongit = 0, ret = 0;
+ int nongit = 0, ret = 0, saved_errno = errno;
const char *subdir;
subdir = setup_git_directory_gently(&nongit);
if (subdir)
chdir(subdir);
+ errno = saved_errno;
+
return ret;
}