read_raw_ref(): don't get confused by an empty directory
Even if there is an empty directory where we look for the loose version of a reference, check for a packed reference before giving up. This fixes the failing test that was introduced two commits ago. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
This commit is contained in:
@ -1477,7 +1477,16 @@ stat_ref:
|
||||
|
||||
/* Is it a directory? */
|
||||
if (S_ISDIR(st.st_mode)) {
|
||||
errno = EISDIR;
|
||||
/*
|
||||
* Even though there is a directory where the loose
|
||||
* ref is supposed to be, there could still be a
|
||||
* packed ref:
|
||||
*/
|
||||
if (resolve_missing_loose_ref(refname, sha1, flags)) {
|
||||
errno = EISDIR;
|
||||
goto out;
|
||||
}
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user