diff mbox series

[v3,1/1] list-objects.c: rename "traverse_trees_and_blobs" to "traverse_non_commits"

Message ID 8548aa8bb1ee89b9cce677c7fa35005fa15c5435.1628758416.git.dyroneteng@gmail.com (mailing list archive)
State Accepted
Commit b3e36df0d4daa7ede26e0c7252564f43662778d6
Headers show
Series list-objects.c: rename "traverse_trees_and_blobs" to "traverse_non_commits" | expand

Commit Message

Teng Long Aug. 12, 2021, 8:59 a.m. UTC
Function `traverse_trees_and_blobs` not only works on trees and blobs,
but also on tags, the function name is somewhat misleading. This commit
rename it to `traverse_non_commits`.

Signed-off-by: Teng Long <dyroneteng@gmail.com>
---
 list-objects.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Jeff King Aug. 12, 2021, 7:24 p.m. UTC | #1
On Thu, Aug 12, 2021 at 04:59:31PM +0800, Teng Long wrote:

> Function `traverse_trees_and_blobs` not only works on trees and blobs,
> but also on tags, the function name is somewhat misleading. This commit
> rename it to `traverse_non_commits`.

Thanks, this version looks good to me.

-Peff
diff mbox series

Patch

diff --git a/list-objects.c b/list-objects.c
index 7f404677d5..11d97ac380 100644
--- a/list-objects.c
+++ b/list-objects.c
@@ -334,8 +334,8 @@  static void add_pending_tree(struct rev_info *revs, struct tree *tree)
 	add_pending_object(revs, &tree->object, "");
 }
 
-static void traverse_trees_and_blobs(struct traversal_context *ctx,
-				     struct strbuf *base)
+static void traverse_non_commits(struct traversal_context *ctx,
+				 struct strbuf *base)
 {
 	int i;
 
@@ -407,9 +407,9 @@  static void do_traverse(struct traversal_context *ctx)
 			 * needs a reallocation for each commit. Can we pass the
 			 * tree directory without allocation churn?
 			 */
-			traverse_trees_and_blobs(ctx, &csp);
+			traverse_non_commits(ctx, &csp);
 	}
-	traverse_trees_and_blobs(ctx, &csp);
+	traverse_non_commits(ctx, &csp);
 	strbuf_release(&csp);
 }