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 <mhagger@alum.mit.edu>

Michael Haggerty committed Apr 22, 2016 at 09:13 UTC bcb497d0f83f9c3e60f00fd2cc87130923329ed9
1 file changed +3 -6
refs/files-backend.c
+3 -6
@@ -1738,7 +1738,7 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
1738 const unsigned char *old_sha1,
1739 const struct string_list *extras,
1740 const struct string_list *skip,
1741 - unsigned int flags, int *type_p,
1741 + unsigned int flags, int *type,
1742 struct strbuf *err)
1743 {
1744 struct strbuf ref_file = STRBUF_INIT;
@@ -1746,7 +1746,6 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
1746 const char *orig_refname = refname;
1747 struct ref_lock *lock;
1748 int last_errno = 0;
1749 - int type;
1749 int lflags = 0;
1750 int mustexist = (old_sha1 && !is_null_sha1(old_sha1));
1751 int resolve_flags = 0;
@@ -1766,7 +1765,7 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
1765 }
1766
1767 refname = resolve_ref_unsafe(refname, resolve_flags,
1769 - lock->old_oid.hash, &type);
1768 + lock->old_oid.hash, type);
1769 if (!refname && errno == EISDIR) {
1770 /*
1771 * 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,
1783 goto error_return;
1784 }
1785 refname = resolve_ref_unsafe(orig_refname, resolve_flags,
1787 - lock->old_oid.hash, &type);
1786 + lock->old_oid.hash, type);
1787 }
1789 - if (type_p)
1790 - *type_p = type;
1788 if (!refname) {
1789 last_errno = errno;
1790 if (last_errno != ENOTDIR ||