Skip to content

Commit e94eac4

Browse files
rscharfegitster
authored andcommitted
http-push: don't check return value of lookup_unknown_object()
This function always returns a reference to an object, creating one if needed, so remove the unnecessary NULL check. Signed-off-by: Rene Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c3808ca commit e94eac4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

http-push.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,11 +1431,9 @@ static void one_remote_ref(const char *refname)
14311431
*/
14321432
if (repo->can_update_info_refs && !has_object_file(&ref->old_oid)) {
14331433
obj = lookup_unknown_object(ref->old_oid.hash);
1434-
if (obj) {
1435-
fprintf(stderr, " fetch %s for %s\n",
1436-
oid_to_hex(&ref->old_oid), refname);
1437-
add_fetch_request(obj);
1438-
}
1434+
fprintf(stderr, " fetch %s for %s\n",
1435+
oid_to_hex(&ref->old_oid), refname);
1436+
add_fetch_request(obj);
14391437
}
14401438

14411439
ref->next = remote_refs;

0 commit comments

Comments
 (0)