]> git.ipfire.org Git - thirdparty/git.git/commitdiff
promisor-remote: remove a return value
authorJonathan Tan <jonathantanmy@google.com>
Tue, 4 Oct 2022 21:13:40 +0000 (14:13 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Oct 2022 18:06:52 +0000 (11:06 -0700)
No caller of promisor_remote_get_direct() is checking its return value,
so remove it.

Not checking the return value means that the user would not know
whether the failure of reading an object is due to the promisor remote
not supplying the object or because of local repository corruption, but
this will be fixed in a subsequent patch.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
promisor-remote.c
promisor-remote.h

index 68f46f5ec70b93b28fa7c75988d671a4046e8fee..8b4d650b4c491349f6cebd942aa37f8a9396f690 100644 (file)
@@ -230,18 +230,17 @@ static int remove_fetched_oids(struct repository *repo,
        return remaining_nr;
 }
 
-int promisor_remote_get_direct(struct repository *repo,
-                              const struct object_id *oids,
-                              int oid_nr)
+void promisor_remote_get_direct(struct repository *repo,
+                               const struct object_id *oids,
+                               int oid_nr)
 {
        struct promisor_remote *r;
        struct object_id *remaining_oids = (struct object_id *)oids;
        int remaining_nr = oid_nr;
        int to_free = 0;
-       int res = -1;
 
        if (oid_nr == 0)
-               return 0;
+               return;
 
        promisor_remote_init(repo);
 
@@ -256,12 +255,9 @@ int promisor_remote_get_direct(struct repository *repo,
                                continue;
                        }
                }
-               res = 0;
                break;
        }
 
        if (to_free)
                free(remaining_oids);
-
-       return res;
 }
index edc45ab0f5fdcd8c4145aa1c81eb3346f2eeeda9..df36eb08efc2e194b6fc4f770235fb9707770de6 100644 (file)
@@ -39,13 +39,12 @@ static inline int has_promisor_remote(void)
 
 /*
  * Fetches all requested objects from all promisor remotes, trying them one at
- * a time until all objects are fetched. Returns 0 upon success, and non-zero
- * otherwise.
+ * a time until all objects are fetched.
  *
- * If oid_nr is 0, this function returns 0 (success) immediately.
+ * If oid_nr is 0, this function returns immediately.
  */
-int promisor_remote_get_direct(struct repository *repo,
-                              const struct object_id *oids,
-                              int oid_nr);
+void promisor_remote_get_direct(struct repository *repo,
+                               const struct object_id *oids,
+                               int oid_nr);
 
 #endif /* PROMISOR_REMOTE_H */