git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stefan Beller <sbeller@google.com>
To: gitster@pobox.com, git@jeffhostetler.com
Cc: git@vger.kernel.org, Stefan Beller <sbeller@google.com>
Subject: [PATCH 11/24] cache.h: drop cache_file_exists
Date: Tue,  2 May 2017 15:23:09 -0700	[thread overview]
Message-ID: <20170502222322.21055-12-sbeller@google.com> (raw)
In-Reply-To: <20170502222322.21055-1-sbeller@google.com>

Signed-off-by: Stefan Beller <sbeller@google.com>
---
 apply.c           | 2 +-
 cache.h           | 1 -
 dir.c             | 9 +++++----
 merge-recursive.c | 3 ++-
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/apply.c b/apply.c
index 159e039a18..eb8eaeabec 100644
--- a/apply.c
+++ b/apply.c
@@ -3810,7 +3810,7 @@ static int path_is_beyond_symlink_1(struct apply_state *state, struct strbuf *na
 		if (state->check_index) {
 			struct cache_entry *ce;
 
-			ce = cache_file_exists(name->buf, name->len, ignore_case);
+			ce = index_file_exists(&the_index, name->buf, name->len, ignore_case);
 			if (ce && S_ISLNK(ce->ce_mode))
 				return 1;
 		} else {
diff --git a/cache.h b/cache.h
index 5de8ab4e69..85a85f8b96 100644
--- a/cache.h
+++ b/cache.h
@@ -369,7 +369,6 @@ extern void free_name_hash(struct index_state *istate);
 #define ce_match_stat(ce, st, options) ie_match_stat(&the_index, (ce), (st), (options))
 #define ce_modified(ce, st, options) ie_modified(&the_index, (ce), (st), (options))
 #define cache_dir_exists(name, namelen) index_dir_exists(&the_index, (name), (namelen))
-#define cache_file_exists(name, namelen, igncase) index_file_exists(&the_index, (name), (namelen), (igncase))
 #endif
 
 enum object_type {
diff --git a/dir.c b/dir.c
index d5e1c462bb..0327832e53 100644
--- a/dir.c
+++ b/dir.c
@@ -1235,7 +1235,7 @@ static struct dir_entry *dir_entry_new(const char *pathname, int len)
 
 static struct dir_entry *dir_add_name(struct dir_struct *dir, const char *pathname, int len)
 {
-	if (cache_file_exists(pathname, len, ignore_case))
+	if (index_file_exists(&the_index, pathname, len, ignore_case))
 		return NULL;
 
 	ALLOC_GROW(dir->entries, dir->nr+1, dir->alloc);
@@ -1269,7 +1269,7 @@ static enum exist_status directory_exists_in_index_icase(const char *dirname, in
 	if (cache_dir_exists(dirname, len))
 		return index_directory;
 
-	ce = cache_file_exists(dirname, len, ignore_case);
+	ce = index_file_exists(&the_index, dirname, len, ignore_case);
 	if (ce && S_ISGITLINK(ce->ce_mode))
 		return index_gitdir;
 
@@ -1460,7 +1460,7 @@ static int get_index_dtype(const char *path, int len)
 	int pos;
 	const struct cache_entry *ce;
 
-	ce = cache_file_exists(path, len, 0);
+	ce = index_file_exists(&the_index, path, len, 0);
 	if (ce) {
 		if (!ce_uptodate(ce))
 			return DT_UNKNOWN;
@@ -1522,7 +1522,8 @@ static enum path_treatment treat_one_path(struct dir_struct *dir,
 					  int dtype, struct dirent *de)
 {
 	int exclude;
-	int has_path_in_index = !!cache_file_exists(path->buf, path->len, ignore_case);
+	int has_path_in_index = !!index_file_exists(&the_index, path->buf,
+						    path->len, ignore_case);
 
 	if (dtype == DT_UNKNOWN)
 		dtype = get_dtype(de, path->buf, path->len);
diff --git a/merge-recursive.c b/merge-recursive.c
index 57ca250c88..b8b3a153f1 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -623,7 +623,8 @@ static int remove_file(struct merge_options *o, int clean,
 	if (update_working_directory) {
 		if (ignore_case) {
 			struct cache_entry *ce;
-			ce = cache_file_exists(path, strlen(path), ignore_case);
+			ce = index_file_exists(&the_index, path,
+					       strlen(path), ignore_case);
 			if (ce && ce_stage(ce) == 0)
 				return 0;
 		}
-- 
2.13.0.rc1.39.ga6db8bfa24


  parent reply	other threads:[~2017-05-02 22:24 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-02 22:22 [PATCH 00/24] Retire NO_THE_INDEX_COMPATIBILITY_MACROS Stefan Beller
2017-05-02 22:22 ` [PATCH 01/24] cache.h: drop read_cache() Stefan Beller
2017-05-02 22:23 ` [PATCH 02/24] cache.h: drop active_* macros Stefan Beller
2017-05-02 22:23 ` [PATCH 03/24] cache.h: drop read_cache_from Stefan Beller
2017-05-02 22:23 ` [PATCH 04/24] cache.h: drop read_cache_preload(pathspec) Stefan Beller
2017-05-02 22:23 ` [PATCH 05/24] cache.h: drop read_cache_unmerged() Stefan Beller
2017-05-02 22:23 ` [PATCH 06/24] unpack-trees.c: rename parameter 'the_index' Stefan Beller
2017-05-02 22:23 ` [PATCH 07/24] cache.h: drop read_blob_data_from_cache Stefan Beller
2017-05-02 22:23 ` [PATCH 08/24] cache.h: drop unmerge_cache[_entry_at] Stefan Beller
2017-05-02 22:23 ` [PATCH 09/24] cache.h: drop resolve_undo_clear Stefan Beller
2017-05-02 22:23 ` [PATCH 10/24] cache.h: drop cache_name_is_other Stefan Beller
2017-05-02 22:23 ` Stefan Beller [this message]
2017-05-02 22:23 ` [PATCH 12/24] cache.h: drop cache_dir_exists Stefan Beller
2017-05-02 22:23 ` [PATCH 13/24] cache.h: drop is_cache_unborn(), discard_cache(), unmerged_cache() Stefan Beller
2017-05-02 22:23 ` [PATCH 14/24] cache.h: drop cache_name_pos Stefan Beller
2017-05-02 22:23 ` [PATCH 15/24] cache.h: drop add_cache_entry Stefan Beller
2017-05-02 22:23 ` [PATCH 16/24] cache.h: drop rename_cache_entry_at Stefan Beller
2017-05-02 22:23 ` [PATCH 17/24] cache.h: drop remove_file_from_cache Stefan Beller
2017-05-02 22:23 ` [PATCH 18/24] cache.h: drop add_to_cache Stefan Beller
2017-05-02 22:23 ` [PATCH 19/24] cache.h: drop add_file_to_cache Stefan Beller
2017-05-02 22:23 ` [PATCH 20/24] cache.h: drop chmod_cache_entry Stefan Beller
2017-05-02 22:23 ` [PATCH 21/24] cache.h: drop refresh_cache Stefan Beller
2017-05-02 22:23 ` [PATCH 22/24] cache.h: drop ce_modified Stefan Beller
2017-05-02 22:23 ` [PATCH 23/24] cache.h: drop ce_match_stat Stefan Beller
2017-05-02 22:23 ` [PATCH 24/24] cache.h: retire NO_THE_INDEX_COMPATIBILITY_MACROS Stefan Beller

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20170502222322.21055-12-sbeller@google.com \
    --to=sbeller@google.com \
    --cc=git@jeffhostetler.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).