Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 7b359ea

Browse files
sunshinecogitster
authored andcommitted
name-hash: retire unused index_name_exists()
db5360f (name-hash: refactor polymorphic index_name_exists(); 2013-09-17) split index_name_exists() into index_file_exists() and index_dir_exists() but retained index_name_exists() as a thin wrapper to avoid disturbing possible in-flight topics. Since this change landed in 'master' some time ago and there are no in-flight topics referencing index_name_exists(), retire it. Signed-off-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b6aad99 commit 7b359ea

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

cache.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ extern void free_name_hash(struct index_state *istate);
316316
#define ce_modified(ce, st, options) ie_modified(&the_index, (ce), (st), (options))
317317
#define cache_dir_exists(name, namelen) index_dir_exists(&the_index, (name), (namelen))
318318
#define cache_file_exists(name, namelen, igncase) index_file_exists(&the_index, (name), (namelen), (igncase))
319-
#define cache_name_exists(name, namelen, igncase) index_name_exists(&the_index, (name), (namelen), (igncase))
320319
#define cache_name_is_other(name, namelen) index_name_is_other(&the_index, (name), (namelen))
321320
#define resolve_undo_clear() resolve_undo_clear_index(&the_index)
322321
#define unmerge_cache_entry_at(at) unmerge_index_entry_at(&the_index, at)
@@ -467,7 +466,6 @@ extern int unmerged_index(const struct index_state *);
467466
extern int verify_path(const char *path);
468467
extern struct cache_entry *index_dir_exists(struct index_state *istate, const char *name, int namelen);
469468
extern struct cache_entry *index_file_exists(struct index_state *istate, const char *name, int namelen, int igncase);
470-
extern struct cache_entry *index_name_exists(struct index_state *istate, const char *name, int namelen, int igncase);
471469
extern int index_name_pos(const struct index_state *, const char *name, int namelen);
472470
#define ADD_CACHE_OK_TO_ADD 1 /* Ok to add */
473471
#define ADD_CACHE_OK_TO_REPLACE 2 /* Ok to replace file/directory */

name-hash.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static int cache_entry_cmp(const struct cache_entry *ce1,
115115
{
116116
/*
117117
* For remove_name_hash, find the exact entry (pointer equality); for
118-
* index_name_exists, find all entries with matching hash code and
118+
* index_file_exists, find all entries with matching hash code and
119119
* decide whether the entry matches in same_name.
120120
*/
121121
return remove ? !(ce1 == ce2) : 0;
@@ -227,13 +227,6 @@ struct cache_entry *index_file_exists(struct index_state *istate, const char *na
227227
return NULL;
228228
}
229229

230-
struct cache_entry *index_name_exists(struct index_state *istate, const char *name, int namelen, int icase)
231-
{
232-
if (namelen > 0 && name[namelen - 1] == '/')
233-
return index_dir_exists(istate, name, namelen - 1);
234-
return index_file_exists(istate, name, namelen, icase);
235-
}
236-
237230
void free_name_hash(struct index_state *istate)
238231
{
239232
if (!istate->name_hash_initialized)

0 commit comments

Comments
 (0)