]> git.ipfire.org Git - thirdparty/git.git/blobdiff - refs/files-backend.c
refs API: make refs_read_raw_ref() not set errno
[thirdparty/git.git] / refs / files-backend.c
index 6a6ead0b99bbd8b0326081516e3b6cac45366012..94c194665ed98fa11de77586dc5d8bdf0819461f 100644 (file)
@@ -381,10 +381,11 @@ stat_ref:
                goto out;
 
        if (lstat(path, &st) < 0) {
+               int ignore_errno;
                if (errno != ENOENT)
                        goto out;
-               if (refs_read_raw_ref(refs->packed_ref_store, refname,
-                                     oid, referent, type)) {
+               if (refs_read_raw_ref(refs->packed_ref_store, refname, oid,
+                                     referent, type, &ignore_errno)) {
                        errno = ENOENT;
                        goto out;
                }
@@ -418,13 +419,14 @@ stat_ref:
 
        /* Is it a directory? */
        if (S_ISDIR(st.st_mode)) {
+               int ignore_errno;
                /*
                 * Even though there is a directory where the loose
                 * ref is supposed to be, there could still be a
                 * packed ref:
                 */
-               if (refs_read_raw_ref(refs->packed_ref_store, refname,
-                                     oid, referent, type)) {
+               if (refs_read_raw_ref(refs->packed_ref_store, refname, oid,
+                                     referent, type, &ignore_errno)) {
                        errno = EISDIR;
                        goto out;
                }