diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2016-04-07 15:02:59 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-04-10 11:35:21 -0700 |
commit | e6702e570ba4a8501362594b66b74d0ecff002dd (patch) | |
tree | 9fdbc33c42368331d2f50f200e02f248ea5ed8dc /refs | |
parent | resolve_ref_1(): eliminate local variable (diff) | |
download | tgif-e6702e570ba4a8501362594b66b74d0ecff002dd.tar.xz |
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>
Diffstat (limited to 'refs')
-rw-r--r-- | refs/files-backend.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; } } |