summaryrefslogtreecommitdiff
path: root/http-push.c
diff options
context:
space:
mode:
Diffstat (limited to 'http-push.c')
-rw-r--r--http-push.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/http-push.c b/http-push.c
index d4b40c9c60..f2c4256312 100644
--- a/http-push.c
+++ b/http-push.c
@@ -304,7 +304,7 @@ static void start_fetch_packed(struct transfer_request *request)
struct transfer_request *check_request = request_queue_head;
struct http_pack_request *preq;
- target = find_sha1_pack(request->obj->sha1, repo->packs);
+ target = repo->packs ? find_sha1_pack(request->obj->sha1, repo->packs) : NULL;
if (!target) {
fprintf(stderr, "Unable to fetch %s, will not be able to update server info refs\n", sha1_to_hex(request->obj->sha1));
repo->can_update_info_refs = 0;
@@ -677,7 +677,7 @@ static int add_send_request(struct object *obj, struct remote_lock *lock)
get_remote_object_list(obj->sha1[0]);
if (obj->flags & (REMOTE | PUSHING))
return 0;
- target = find_sha1_pack(obj->sha1, repo->packs);
+ target = repo->packs ? find_sha1_pack(obj->sha1, repo->packs) : NULL;
if (target) {
obj->flags |= REMOTE;
return 0;