summaryrefslogtreecommitdiff
path: root/run-command.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-09-03 15:53:26 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-09-03 15:53:26 -0700
commit12d858aeb45f6eae3eaecb49ccb6f61affca54cd (patch)
treea6a06df2210d7496665406a71df4796f9afd919f /run-command.c
parentMerge branch 'jc/maint-config-exit-status' (diff)
parentsane_execvp(): ignore non-directory on $PATH (diff)
downloadtgif-12d858aeb45f6eae3eaecb49ccb6f61affca54cd.tar.xz
Merge branch 'jc/maint-sane-execvp-notdir'
"git foo" errored out with "Not a directory" when the user had a non directory on $PATH, and worse yet it masked an alias "foo" to run. * jc/maint-sane-execvp-notdir: sane_execvp(): ignore non-directory on $PATH
Diffstat (limited to 'run-command.c')
-rw-r--r--run-command.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/run-command.c b/run-command.c
index 606791dc67..f9922b9ecc 100644
--- a/run-command.c
+++ b/run-command.c
@@ -139,6 +139,8 @@ int sane_execvp(const char *file, char * const argv[])
*/
if (errno == EACCES && !strchr(file, '/'))
errno = exists_in_PATH(file) ? EACCES : ENOENT;
+ else if (errno == ENOTDIR && !strchr(file, '/'))
+ errno = ENOENT;
return -1;
}