diff mbox series

[v3,11/14] update-index: remove ce_match_stat(), all macros

Message ID e9d4fa613a65e0fedde0648b5fbf71e16f8fe8a0.1610136177.git.gitgitgadget@gmail.com (mailing list archive)
State New, archived
Headers show
Series Remove more index compatibility macros | expand

Commit Message

Derrick Stolee Jan. 8, 2021, 8:02 p.m. UTC
From: Derrick Stolee <dstolee@microsoft.com>

The final index compatibility macro to remove from the update-index
builtin is ce_match_stat(). Further, this is the last use of that macro
anywhere, so it should be removed.

There are some remaining references in the racy-git.txt technical
document that are updated to ie_match_stat().

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
---
 Documentation/technical/racy-git.txt | 6 +++---
 builtin/update-index.c               | 3 +--
 cache.h                              | 1 -
 3 files changed, 4 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/Documentation/technical/racy-git.txt b/Documentation/technical/racy-git.txt
index ceda4bbfda4..65188e04559 100644
--- a/Documentation/technical/racy-git.txt
+++ b/Documentation/technical/racy-git.txt
@@ -26,7 +26,7 @@  information obtained from the filesystem via `lstat(2)` system
 call when they were last updated.  When checking if they differ,
 Git first runs `lstat(2)` on the files and compares the result
 with this information (this is what was originally done by the
-`ce_match_stat()` function, but the current code does it in
+`ie_match_stat()` function, but the current code does it in
 `ce_match_stat_basic()` function).  If some of these "cached
 stat information" fields do not match, Git can tell that the
 files are modified without even looking at their contents.
@@ -102,7 +102,7 @@  timestamp as the index file itself.
 
 The callers that want to check if an index entry matches the
 corresponding file in the working tree continue to call
-`ce_match_stat()`, but with this change, `ce_match_stat()` uses
+`ie_match_stat()`, but with this change, `ie_match_stat()` uses
 `ce_modified_check_fs()` to see if racily clean ones are
 actually clean after comparing the cached stat information using
 `ce_match_stat_basic()`.
@@ -128,7 +128,7 @@  Runtime penalty
 ---------------
 
 The runtime penalty of falling back to `ce_modified_check_fs()`
-from `ce_match_stat()` can be very expensive when there are many
+from `ie_match_stat()` can be very expensive when there are many
 racily clean entries.  An obvious way to artificially create
 this situation is to give the same timestamp to all the files in
 the working tree in a large project, run `git update-index` on
diff --git a/builtin/update-index.c b/builtin/update-index.c
index 64feb47c97f..1c1cb8f8d4a 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -3,7 +3,6 @@ 
  *
  * Copyright (C) Linus Torvalds, 2005
  */
-#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "lockfile.h"
@@ -276,7 +275,7 @@  static int add_one_path(const struct cache_entry *old, const char *path, int len
 	struct cache_entry *ce;
 
 	/* Was the old index entry already up-to-date? */
-	if (old && !ce_stage(old) && !ce_match_stat(old, st, 0))
+	if (old && !ce_stage(old) && !ie_match_stat(istate, old, st, 0))
 		return 0;
 
 	ce = make_empty_cache_entry(istate, len);
diff --git a/cache.h b/cache.h
index 8c091be6256..740bd0aa1dd 100644
--- a/cache.h
+++ b/cache.h
@@ -416,7 +416,6 @@  extern struct index_state the_index;
 #define chmod_cache_entry(ce, flip) chmod_index_entry(&the_index, (ce), (flip))
 #define refresh_cache(flags) refresh_index(&the_index, (flags), NULL, NULL, NULL)
 #define refresh_and_write_cache(refresh_flags, write_flags, gentle) repo_refresh_and_write_index(the_repository, (refresh_flags), (write_flags), (gentle), NULL, NULL, NULL)
-#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_name_is_other(name, namelen) index_name_is_other(&the_index, (name), (namelen))