X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=refs.c;h=98327d798375d2bc966f877af227a03070ce5d1b;hb=151602df00b8e5c5b4a8193f59a94b85f9b5aebc;hp=5e653141ceb8183cfb7922c3ad89fd1a0110647a;hpb=9befac470b4cfad529032dbcffcb71242ec71f91;p=git.git diff --git a/refs.c b/refs.c index 5e653141c..98327d798 100644 --- a/refs.c +++ b/refs.c @@ -42,6 +42,12 @@ const char *resolve_ref(const char *path, unsigned char *sha1, int reading) } } + /* Is it a directory? */ + if (S_ISDIR(st.st_mode)) { + errno = EISDIR; + return NULL; + } + /* * Anything else, just open it and try to use it as * a ref