From: Michael Haggerty Date: Fri, 22 Apr 2016 07:13:00 +0000 (+0200) Subject: lock_ref_sha1_basic(): remove unneeded local variable X-Git-Tag: v2.10.0-rc0~98^2~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bcb497d0f83f9c3e60f00fd2cc87130923329ed9;p=git lock_ref_sha1_basic(): remove unneeded local variable resolve_ref_unsafe() can cope with being called with NULL passed to its flags argument. So lock_ref_sha1_basic() can just hand its own type parameter through. Signed-off-by: Michael Haggerty --- diff --git a/refs/files-backend.c b/refs/files-backend.c index c2bd7b8317..dc247e0e7b 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -1738,7 +1738,7 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname, const unsigned char *old_sha1, const struct string_list *extras, const struct string_list *skip, - unsigned int flags, int *type_p, + unsigned int flags, int *type, struct strbuf *err) { struct strbuf ref_file = STRBUF_INIT; @@ -1746,7 +1746,6 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname, const char *orig_refname = refname; struct ref_lock *lock; int last_errno = 0; - int type; int lflags = 0; int mustexist = (old_sha1 && !is_null_sha1(old_sha1)); int resolve_flags = 0; @@ -1766,7 +1765,7 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname, } refname = resolve_ref_unsafe(refname, resolve_flags, - lock->old_oid.hash, &type); + lock->old_oid.hash, type); if (!refname && errno == EISDIR) { /* * we are trying to lock foo but we used to @@ -1784,10 +1783,8 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname, goto error_return; } refname = resolve_ref_unsafe(orig_refname, resolve_flags, - lock->old_oid.hash, &type); + lock->old_oid.hash, type); } - if (type_p) - *type_p = type; if (!refname) { last_errno = errno; if (last_errno != ENOTDIR ||