Merge branch 'ab/refs-errno-cleanup'
A brown-paper-bag fix on top of a topic that was merged during this cycle. * ab/refs-errno-cleanup: refs API: use "failure_errno", not "errno"
This commit is contained in:
commit
31e3912369
2
refs.c
2
refs.c
@ -1722,8 +1722,6 @@ const char *refs_resolve_ref_unsafe(struct ref_store *refs,
|
|||||||
if (refs_read_raw_ref(refs, refname, oid, &sb_refname,
|
if (refs_read_raw_ref(refs, refname, oid, &sb_refname,
|
||||||
&read_flags, failure_errno)) {
|
&read_flags, failure_errno)) {
|
||||||
*flags |= read_flags;
|
*flags |= read_flags;
|
||||||
if (errno)
|
|
||||||
*failure_errno = errno;
|
|
||||||
|
|
||||||
/* In reading mode, refs must eventually resolve */
|
/* In reading mode, refs must eventually resolve */
|
||||||
if (resolve_flags & RESOLVE_REF_READING)
|
if (resolve_flags & RESOLVE_REF_READING)
|
||||||
|
@ -382,7 +382,6 @@ stat_ref:
|
|||||||
if (lstat(path, &st) < 0) {
|
if (lstat(path, &st) < 0) {
|
||||||
int ignore_errno;
|
int ignore_errno;
|
||||||
myerr = errno;
|
myerr = errno;
|
||||||
errno = 0;
|
|
||||||
if (myerr != ENOENT)
|
if (myerr != ENOENT)
|
||||||
goto out;
|
goto out;
|
||||||
if (refs_read_raw_ref(refs->packed_ref_store, refname, oid,
|
if (refs_read_raw_ref(refs->packed_ref_store, refname, oid,
|
||||||
@ -399,7 +398,6 @@ stat_ref:
|
|||||||
strbuf_reset(&sb_contents);
|
strbuf_reset(&sb_contents);
|
||||||
if (strbuf_readlink(&sb_contents, path, st.st_size) < 0) {
|
if (strbuf_readlink(&sb_contents, path, st.st_size) < 0) {
|
||||||
myerr = errno;
|
myerr = errno;
|
||||||
errno = 0;
|
|
||||||
if (myerr == ENOENT || myerr == EINVAL)
|
if (myerr == ENOENT || myerr == EINVAL)
|
||||||
/* inconsistent with lstat; retry */
|
/* inconsistent with lstat; retry */
|
||||||
goto stat_ref;
|
goto stat_ref;
|
||||||
@ -469,6 +467,7 @@ out:
|
|||||||
|
|
||||||
strbuf_release(&sb_path);
|
strbuf_release(&sb_path);
|
||||||
strbuf_release(&sb_contents);
|
strbuf_release(&sb_contents);
|
||||||
|
errno = 0;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user