{"thread":{"id":"45418","subject":"[PATCH] http-push: don't check return value of lookup_unknown_object()","startedAt":"2017-03-18T00:41:38Z","lastAt":"2017-03-18T00:41:38Z","messageCount":1,"participants":["René Scharfe"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"314433","messageId":"1a7123f5-9017-7602-03f4-5123cdebe541@web.de","threadId":"45418","inReplyTo":null,"subject":"[PATCH] http-push: don't check return value of lookup_unknown_object()","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2017-03-17T22:12:31Z","receivedAt":"2017-03-18T00:41:38Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"This function always returns a reference to an object, creating one if\nneeded, so remove the unnecessary NULL check.\n\nSigned-off-by: Rene Scharfe <l.s.r@web.de>\n---\n http-push.c | 8 +++-----\n 1 file changed, 3 insertions(+), 5 deletions(-)\n\ndiff --git a/http-push.c b/http-push.c\nindex 704b1c837c..f0e3108f71 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -1431,11 +1431,9 @@ static void one_remote_ref(const char *refname)\n \t */\n \tif (repo->can_update_info_refs && !has_object_file(&ref->old_oid)) {\n \t\tobj = lookup_unknown_object(ref->old_oid.hash);\n-\t\tif (obj) {\n-\t\t\tfprintf(stderr,\t\"  fetch %s for %s\\n\",\n-\t\t\t\toid_to_hex(&ref->old_oid), refname);\n-\t\t\tadd_fetch_request(obj);\n-\t\t}\n+\t\tfprintf(stderr,\t\"  fetch %s for %s\\n\",\n+\t\t\toid_to_hex(&ref->old_oid), refname);\n+\t\tadd_fetch_request(obj);\n \t}\n \n \tref->next = remote_refs;\n-- \n2.12.0\n\n"}]}