{"thread":{"id":"35559","subject":"[PATCH] name-hash: retire unused index_name_exists()","startedAt":"2013-12-20T16:05:06Z","lastAt":"2013-12-20T16:05:06Z","messageCount":1,"participants":["Eric Sunshine"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"232287","messageId":"1387555506-3882-1-git-send-email-sunshine@sunshineco.com","threadId":"35559","inReplyTo":null,"subject":"[PATCH] name-hash: retire unused index_name_exists()","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-12-20T16:05:06Z","receivedAt":"2013-12-20T16:05:06Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"db5360f3f496 (name-hash: refactor polymorphic index_name_exists();\n2013-09-17) split index_name_exists() into index_file_exists() and\nindex_dir_exists() but retained index_name_exists() as a thin wrapper\nto avoid disturbing possible in-flight topics. Since this change\nlanded in 'master' some time ago and there are no in-flight topics\nreferencing index_name_exists(), retire it.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n\nPerhaps now is a good time to retire this unused function?\n\nThis patch conflicts textually with kb/fast-hashmap in 'pu', although,\nsince both are merely removing functions from name-hash.c at the point\nof conflict, the resolution should be straightforward.\n\n cache.h     | 2 --\n name-hash.c | 7 -------\n 2 files changed, 9 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex ce377e1..23f207a 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -316,7 +316,6 @@ extern void free_name_hash(struct index_state *istate);\n #define ce_modified(ce, st, options) ie_modified(&the_index, (ce), (st), (options))\n #define cache_dir_exists(name, namelen) index_dir_exists(&the_index, (name), (namelen))\n #define cache_file_exists(name, namelen, igncase) index_file_exists(&the_index, (name), (namelen), (igncase))\n-#define cache_name_exists(name, namelen, igncase) index_name_exists(&the_index, (name), (namelen), (igncase))\n #define cache_name_is_other(name, namelen) index_name_is_other(&the_index, (name), (namelen))\n #define resolve_undo_clear() resolve_undo_clear_index(&the_index)\n #define unmerge_cache_entry_at(at) unmerge_index_entry_at(&the_index, at)\n@@ -466,7 +465,6 @@ extern int unmerged_index(const struct index_state *);\n extern int verify_path(const char *path);\n extern struct cache_entry *index_dir_exists(struct index_state *istate, const char *name, int namelen);\n extern struct cache_entry *index_file_exists(struct index_state *istate, const char *name, int namelen, int igncase);\n-extern struct cache_entry *index_name_exists(struct index_state *istate, const char *name, int namelen, int igncase);\n extern int index_name_pos(const struct index_state *, const char *name, int namelen);\n #define ADD_CACHE_OK_TO_ADD 1\t\t/* Ok to add */\n #define ADD_CACHE_OK_TO_REPLACE 2\t/* Ok to replace file/directory */\ndiff --git a/name-hash.c b/name-hash.c\nindex e5b6e1a..715f95c 100644\n--- a/name-hash.c\n+++ b/name-hash.c\n@@ -263,13 +263,6 @@ struct cache_entry *index_file_exists(struct index_state *istate, const char *na\n \treturn NULL;\n }\n \n-struct cache_entry *index_name_exists(struct index_state *istate, const char *name, int namelen, int icase)\n-{\n-\tif (namelen > 0 && name[namelen - 1] == '/')\n-\t\treturn index_dir_exists(istate, name, namelen - 1);\n-\treturn index_file_exists(istate, name, namelen, icase);\n-}\n-\n static int free_dir_entry(void *entry, void *unused)\n {\n \tstruct dir_entry *dir = entry;\n-- \n1.8.3.2\n"}]}