upload-pack: remove unused variable "backup"
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sun, 12 Jun 2016 10:53:47 +0000 (17:53 +0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Jun 2016 21:38:16 +0000 (14:38 -0700)
After the last patch, "result" and "backup" are the same. "result" used
to move, but the movement is now contained in send_shallow(). Delete
this redundant variable.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
upload-pack.c
index 0eb9a0b8fa5cb7fe9c133b1a63defccff7d1632b..ee5d20b80181f497241cc86a75f7cc2b97072401 100644 (file)
@@ -554,7 +554,7 @@ static void send_shallow(struct commit_list *result)
 
 static void deepen(int depth, const struct object_array *shallows)
 {
-       struct commit_list *result = NULL, *backup = NULL;
+       struct commit_list *result = NULL;
        int i;
        if (depth == INFINITE_DEPTH && !is_repository_shallow())
                for (i = 0; i < shallows->nr; i++) {
@@ -562,11 +562,10 @@ static void deepen(int depth, const struct object_array *shallows)
                        object->flags |= NOT_SHALLOW;
                }
        else
-               backup = result =
-                       get_shallow_commits(&want_obj, depth,
-                                           SHALLOW, NOT_SHALLOW);
+               result = get_shallow_commits(&want_obj, depth,
+                                            SHALLOW, NOT_SHALLOW);
        send_shallow(result);
-       free_commit_list(backup);
+       free_commit_list(result);
        for (i = 0; i < shallows->nr; i++) {
                struct object *object = shallows->objects[i].item;
                if (object->flags & NOT_SHALLOW) {