git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, me@ttaylorr.com,
	Eric Sunshine <sunshine@sunshineco.com>,
	Derrick Stolee <derrickstolee@github.com>,
	Derrick Stolee <derrickstolee@github.com>
Subject: [PATCH v2 4/4] cache-tree: remove cache_tree_find_path()
Date: Thu, 16 Jun 2022 13:13:50 +0000	[thread overview]
Message-ID: <8486a1d6eca66e2d71b4317ce03318aed6346bc0.1655385230.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1261.v2.git.1655385230.gitgitgadget@gmail.com>

From: Derrick Stolee <derrickstolee@github.com>

This reverts 080ab56a46 (cache-tree: implement cache_tree_find_path(),
2022-05-23). The cache_tree_find_path() method was never actually called
in the topic that added it. I cannot find any reference to it in any of
my forks, so this appears to not be needed at the moment.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
---
 cache-tree.c | 27 ---------------------------
 cache-tree.h |  2 --
 2 files changed, 29 deletions(-)

diff --git a/cache-tree.c b/cache-tree.c
index ff794d940fa..56db0b5026b 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -101,33 +101,6 @@ struct cache_tree_sub *cache_tree_sub(struct cache_tree *it, const char *path)
 	return find_subtree(it, path, pathlen, 1);
 }
 
-struct cache_tree *cache_tree_find_path(struct cache_tree *it, const char *path)
-{
-	const char *slash;
-	int namelen;
-	struct cache_tree_sub it_sub = {
-		.cache_tree = it,
-	};
-	struct cache_tree_sub *down = &it_sub;
-
-	while (down) {
-		slash = strchrnul(path, '/');
-		namelen = slash - path;
-		down->cache_tree->entry_count = -1;
-		if (!*slash) {
-			int pos;
-			pos = cache_tree_subtree_pos(down->cache_tree, path, namelen);
-			if (0 <= pos)
-				return down->cache_tree->down[pos]->cache_tree;
-			return NULL;
-		}
-		down = find_subtree(it, path, namelen, 0);
-		path = slash + 1;
-	}
-
-	return NULL;
-}
-
 static int do_invalidate_path(struct cache_tree *it, const char *path)
 {
 	/* a/b/c
diff --git a/cache-tree.h b/cache-tree.h
index f75f8e74dcd..8efeccebfc9 100644
--- a/cache-tree.h
+++ b/cache-tree.h
@@ -29,8 +29,6 @@ struct cache_tree_sub *cache_tree_sub(struct cache_tree *, const char *);
 
 int cache_tree_subtree_pos(struct cache_tree *it, const char *path, int pathlen);
 
-struct cache_tree *cache_tree_find_path(struct cache_tree *it, const char *path);
-
 void cache_tree_write(struct strbuf *, struct cache_tree *root);
 struct cache_tree *cache_tree_read(const char *buffer, unsigned long size);
 
-- 
gitgitgadget

  parent reply	other threads:[~2022-06-16 13:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-14 21:27 [PATCH 0/4] Reactions to v2.37.0-rc0 test coverage report Derrick Stolee via GitGitGadget
2022-06-14 21:27 ` [PATCH 1/4] t2107: test 'git update-index --verbose' Derrick Stolee via GitGitGadget
2022-06-15 23:18   ` Eric Sunshine
2022-06-16 12:54     ` Derrick Stolee
2022-06-14 21:27 ` [PATCH 2/4] t5329: test 'git gc --cruft' without '--prune=now' Derrick Stolee via GitGitGadget
2022-06-14 23:38   ` Taylor Blau
2022-06-15 13:28     ` Derrick Stolee
2022-06-14 21:27 ` [PATCH 3/4] pack-write: drop always-NULL parameter Derrick Stolee via GitGitGadget
2022-06-14 21:27 ` [PATCH 4/4] cache-tree: remove cache_tree_find_path() Derrick Stolee via GitGitGadget
2022-06-16 13:13 ` [PATCH v2 0/4] Reactions to v2.37.0-rc0 test coverage report Derrick Stolee via GitGitGadget
2022-06-16 13:13   ` [PATCH v2 1/4] t2107: test 'git update-index --verbose' Derrick Stolee via GitGitGadget
2022-06-16 13:13   ` [PATCH v2 2/4] t5329: test 'git gc --cruft' without '--prune=now' Derrick Stolee via GitGitGadget
2022-06-16 13:13   ` [PATCH v2 3/4] pack-write: drop always-NULL parameter Derrick Stolee via GitGitGadget
2022-06-16 13:13   ` Derrick Stolee via GitGitGadget [this message]
2022-06-16 19:13   ` [PATCH v2 0/4] Reactions to v2.37.0-rc0 test coverage report 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=8486a1d6eca66e2d71b4317ce03318aed6346bc0.1655385230.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.com \
    --cc=sunshine@sunshineco.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).