/* 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;
}
'
-test_expect_failure 'empty directory should not fool rev-parse' '
+test_expect_success 'empty directory should not fool rev-parse' '
prefix=refs/e-rev-parse &&
git update-ref $prefix/foo $C &&
git pack-refs --all &&