All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Tan <jonathantanmy@google.com>
To: git@vger.kernel.org
Cc: Jonathan Tan <jonathantanmy@google.com>
Subject: [PATCH 1/2] promisor-remote: remove a return value
Date: Tue, 27 Sep 2022 15:12:29 -0700	[thread overview]
Message-ID: <7cef8088cebe368e66237837eacec71381182ec1.1664316642.git.jonathantanmy@google.com> (raw)
In-Reply-To: <cover.1664316642.git.jonathantanmy@google.com>

No caller of promisor_remote_get_direct() is checking its return value,
so remove it.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
---
 promisor-remote.c | 12 ++++--------
 promisor-remote.h | 11 +++++------
 2 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/promisor-remote.c b/promisor-remote.c
index 68f46f5ec7..8b4d650b4c 100644
--- a/promisor-remote.c
+++ b/promisor-remote.c
@@ -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;
 }
diff --git a/promisor-remote.h b/promisor-remote.h
index edc45ab0f5..df36eb08ef 100644
--- a/promisor-remote.h
+++ b/promisor-remote.h
@@ -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 */
-- 
2.37.3.998.g577e59143f-goog


  reply	other threads:[~2022-09-27 22:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-27 22:12 [PATCH 0/2] Fail early when partial clone prefetch fails Jonathan Tan
2022-09-27 22:12 ` Jonathan Tan [this message]
2022-09-29 19:23   ` [PATCH 1/2] promisor-remote: remove a return value Junio C Hamano
2022-09-30 22:02     ` Jonathan Tan
2022-09-27 22:12 ` [PATCH 2/2] promisor-remote: die upon failing fetch Jonathan Tan
2022-09-28 17:43   ` Glen Choo
2022-09-30 22:10     ` Jonathan Tan
2022-09-29 20:14   ` Junio C Hamano
2022-09-29 20:15 ` [PATCH 0/2] Fail early when partial clone prefetch fails Junio C Hamano
2022-09-30 21:50   ` Jonathan Tan
2022-09-30 22:17     ` Junio C Hamano
2022-10-04 21:13 ` [PATCH v2 " Jonathan Tan
2022-10-04 21:13   ` [PATCH v2 1/2] promisor-remote: remove a return value Jonathan Tan
2022-10-04 21:13   ` [PATCH v2 2/2] promisor-remote: die upon failing fetch Jonathan Tan
2022-10-05 18:09   ` [PATCH v2 0/2] Fail early when partial clone prefetch fails Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7cef8088cebe368e66237837eacec71381182ec1.1664316642.git.jonathantanmy@google.com \
    --to=jonathantanmy@google.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.