Skip to content

Commit

Permalink
refs: remove EINVAL and ELOOP errno from refs_resolve_ref_unsafe_with…
Browse files Browse the repository at this point in the history
…_errno()

There is only one caller in refs/files-backend.c, and it only cares about EISDIR
and ENOTDIR.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
  • Loading branch information
hanwen committed Apr 29, 2021
1 parent 0fde50e commit 0b12744
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1707,7 +1707,6 @@ static const char *refs_resolve_ref_unsafe_errno(struct ref_store *refs,
if (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL)) {
if (!(resolve_flags & RESOLVE_REF_ALLOW_BAD_NAME) ||
!refname_is_safe(refname)) {
errno = EINVAL;
return NULL;
}

Expand Down Expand Up @@ -1767,15 +1766,13 @@ static const char *refs_resolve_ref_unsafe_errno(struct ref_store *refs,
if (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL)) {
if (!(resolve_flags & RESOLVE_REF_ALLOW_BAD_NAME) ||
!refname_is_safe(refname)) {
errno = EINVAL;
return NULL;
}

*flags |= REF_ISBROKEN | REF_BAD_NAME;
}
}

errno = ELOOP;
return NULL;
}

Expand Down

0 comments on commit 0b12744

Please sign in to comment.