diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-01-14 15:25:14 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-01-14 15:25:15 -0800 |
commit | 31e391236958c2e75787b7579146b3569fb6ec17 (patch) | |
tree | 16e512db09a8a8cfad7ecea1d9c2e482fff88144 /refs | |
parent | Last minute fixes before -rc1 (diff) | |
parent | refs API: use "failure_errno", not "errno" (diff) | |
download | tgif-31e391236958c2e75787b7579146b3569fb6ec17.tar.xz |
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"
Diffstat (limited to 'refs')
-rw-r--r-- | refs/files-backend.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c index b529fdf237..43a3b882d7 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -382,7 +382,6 @@ stat_ref: if (lstat(path, &st) < 0) { int ignore_errno; myerr = errno; - errno = 0; if (myerr != ENOENT) goto out; if (refs_read_raw_ref(refs->packed_ref_store, refname, oid, @@ -399,7 +398,6 @@ stat_ref: strbuf_reset(&sb_contents); if (strbuf_readlink(&sb_contents, path, st.st_size) < 0) { myerr = errno; - errno = 0; if (myerr == ENOENT || myerr == EINVAL) /* inconsistent with lstat; retry */ goto stat_ref; @@ -469,6 +467,7 @@ out: strbuf_release(&sb_path); strbuf_release(&sb_contents); + errno = 0; return ret; } |