resolve_ref_1(): reorder code
There is no need to adjust *flags if we're just about to fail. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: David Turner <dturner@twopensource.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
90c28ae11c
commit
e6702e570b
@ -1542,13 +1542,13 @@ static const char *resolve_ref_1(const char *refname,
|
|||||||
return refname;
|
return refname;
|
||||||
}
|
}
|
||||||
if (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL)) {
|
if (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL)) {
|
||||||
*flags |= REF_ISBROKEN;
|
|
||||||
|
|
||||||
if (!(resolve_flags & RESOLVE_REF_ALLOW_BAD_NAME) ||
|
if (!(resolve_flags & RESOLVE_REF_ALLOW_BAD_NAME) ||
|
||||||
!refname_is_safe(refname)) {
|
!refname_is_safe(refname)) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*flags |= REF_ISBROKEN;
|
||||||
bad_name = 1;
|
bad_name = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user