write_ref_sha1(): remove check for lock == NULL
authorMichael Haggerty <mhagger@alum.mit.edu>
Mon, 2 Mar 2015 09:29:51 +0000 (10:29 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 5 Mar 2015 20:35:36 +0000 (12:35 -0800)
None of the callers pass NULL to this function, and there doesn't seem
to be any usefulness to allowing them to do so.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
diff --git a/refs.c b/refs.c
index c5fa70947f76127dc6a569da68d3ed947a128e7a..d1130e2259689ae891990cfb8450a2de77134ca8 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -3080,10 +3080,6 @@ static int write_ref_sha1(struct ref_lock *lock,
        static char term = '\n';
        struct object *o;
 
-       if (!lock) {
-               errno = EINVAL;
-               return -1;
-       }
        if (!lock->force_write && !hashcmp(lock->old_sha1, sha1)) {
                unlock_ref(lock);
                return 0;