From: Michael Haggerty Date: Thu, 7 Apr 2016 19:02:59 +0000 (-0400) Subject: resolve_ref_1(): reorder code X-Git-Tag: v2.9.0-rc0~99^2~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e6702e570ba4a8501362594b66b74d0ecff002dd;p=git resolve_ref_1(): reorder code There is no need to adjust *flags if we're just about to fail. Signed-off-by: Michael Haggerty Signed-off-by: David Turner Signed-off-by: Junio C Hamano --- diff --git a/refs/files-backend.c b/refs/files-backend.c index 69ec9036e0..60f149370a 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -1542,13 +1542,13 @@ static const char *resolve_ref_1(const char *refname, return refname; } if (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL)) { - *flags |= REF_ISBROKEN; - if (!(resolve_flags & RESOLVE_REF_ALLOW_BAD_NAME) || !refname_is_safe(refname)) { errno = EINVAL; return NULL; } + + *flags |= REF_ISBROKEN; bad_name = 1; } }