* [PATCH] http-push: don't check return value of lookup_unknown_object()
@ 2017-03-17 22:12 René Scharfe
0 siblings, 0 replies; only message in thread
From: René Scharfe @ 2017-03-17 22:12 UTC (permalink / raw)
To: Git List; +Cc: Junio C Hamano
This function always returns a reference to an object, creating one if
needed, so remove the unnecessary NULL check.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
http-push.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/http-push.c b/http-push.c
index 704b1c837c..f0e3108f71 100644
--- a/http-push.c
+++ b/http-push.c
@@ -1431,11 +1431,9 @@ static void one_remote_ref(const char *refname)
*/
if (repo->can_update_info_refs && !has_object_file(&ref->old_oid)) {
obj = lookup_unknown_object(ref->old_oid.hash);
- if (obj) {
- fprintf(stderr, " fetch %s for %s\n",
- oid_to_hex(&ref->old_oid), refname);
- add_fetch_request(obj);
- }
+ fprintf(stderr, " fetch %s for %s\n",
+ oid_to_hex(&ref->old_oid), refname);
+ add_fetch_request(obj);
}
ref->next = remote_refs;
--
2.12.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-03-18 0:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-17 22:12 [PATCH] http-push: don't check return value of lookup_unknown_object() René Scharfe
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).