{"thread":{"id":"35206","subject":"[PATCH 1/2] refs: remove unused function invalidate_ref_cache","startedAt":"2013-10-26T17:03:01Z","lastAt":"2013-10-27T04:26:57Z","messageCount":3,"participants":["Stefan Beller","Michael Haggerty"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"229568","messageId":"1382806982-20634-1-git-send-email-stefanbeller@googlemail.com","threadId":"35206","inReplyTo":null,"subject":"[PATCH 1/2] refs: remove unused function invalidate_ref_cache","fromName":"Stefan Beller","fromEmail":"stefanbeller@googlemail.com","sentAt":"2013-10-26T17:03:01Z","receivedAt":"2013-10-26T17:03:01Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"The function 'invalidate_ref_cache' was introduced in 79c7ca5 (2011-10-17,\ninvalidate_ref_cache(): rename function from invalidate_cached_refs())\nby a rename and elevated to be publicly usable in 8be8bde (2011-10-17,\ninvalidate_ref_cache(): expose this function in the refs API)\n\nHowever it is not used anymore, as 8bf90dc (2011-10-17, write_ref_sha1():\nonly invalidate the loose ref cache) and (much) later 506a760 (2013-04-22,\nrefs: change how packed refs are deleted) removed any calls to this\nfunction. So it seems as if we don't need that function any more,\ngood bye!\n\nSigned-off-by: Stefan Beller <stefanbeller@googlemail.com>\n---\n refs.c | 7 -------\n refs.h | 8 --------\n 2 files changed, 15 deletions(-)\n\ndiff --git a/refs.c b/refs.c\nindex 3710748..f9c1957 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -947,13 +947,6 @@ static struct ref_cache *get_ref_cache(const char *submodule)\n \treturn refs;\n }\n \n-void invalidate_ref_cache(const char *submodule)\n-{\n-\tstruct ref_cache *refs = get_ref_cache(submodule);\n-\tclear_packed_ref_cache(refs);\n-\tclear_loose_ref_cache(refs);\n-}\n-\n /* The length of a peeled reference line in packed-refs, including EOL: */\n #define PEELED_LINE_LENGTH 42\n \ndiff --git a/refs.h b/refs.h\nindex b113377..87a1a79 100644\n--- a/refs.h\n+++ b/refs.h\n@@ -165,14 +165,6 @@ extern void unlock_ref(struct ref_lock *lock);\n /** Writes sha1 into the ref specified by the lock. **/\n extern int write_ref_sha1(struct ref_lock *lock, const unsigned char *sha1, const char *msg);\n \n-/*\n- * Invalidate the reference cache for the specified submodule.  Use\n- * submodule=NULL to invalidate the cache for the main module.  This\n- * function must be called if references are changed via a mechanism\n- * other than the refs API.\n- */\n-extern void invalidate_ref_cache(const char *submodule);\n-\n /** Setup reflog before using. **/\n int log_ref_setup(const char *ref_name, char *logfile, int bufsize);\n \n-- \n1.8.4.1.605.g23c6912\n"},{"id":"229569","messageId":"1382806982-20634-2-git-send-email-stefanbeller@googlemail.com","threadId":"35206","inReplyTo":"1382806982-20634-1-git-send-email-stefanbeller@googlemail.com","subject":"[PATCH 2/2] cache: remove unused function 'have_git_dir'","fromName":"Stefan Beller","fromEmail":"stefanbeller@googlemail.com","sentAt":"2013-10-26T17:03:02Z","receivedAt":"2013-10-26T17:03:02Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"This function was added in d2b0708 (2008-09-27, add have_git_dir()\nfunction) as a preparation for adbc0b6 (2008-09-30, cygwin: Use native\nWin32 API for stat).\n\nHowever the second referenced commit was reverted in f66450a (2013-06-22,\ncygwin: Remove the Win32 l/stat() implementation), so we don't need to\nexpose this wrapper function any more as a public API.\n\nSigned-off-by: Stefan Beller <stefanbeller@googlemail.com>\n---\n cache.h       | 1 -\n environment.c | 5 -----\n 2 files changed, 6 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex 464c8fb..7e98f9e 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -398,7 +398,6 @@ extern int is_bare_repository(void);\n extern int is_inside_git_dir(void);\n extern char *git_work_tree_cfg;\n extern int is_inside_work_tree(void);\n-extern int have_git_dir(void);\n extern const char *get_git_dir(void);\n extern int is_git_directory(const char *path);\n extern char *get_object_directory(void);\ndiff --git a/environment.c b/environment.c\nindex 378254c..0a15349 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -155,11 +155,6 @@ int is_bare_repository(void)\n \treturn is_bare_repository_cfg && !get_git_work_tree();\n }\n \n-int have_git_dir(void)\n-{\n-\treturn !!git_dir;\n-}\n-\n const char *get_git_dir(void)\n {\n \tif (!git_dir)\n-- \n1.8.4.1.605.g23c6912\n"},{"id":"229581","messageId":"526C9611.6090200@alum.mit.edu","threadId":"35206","inReplyTo":"1382806982-20634-1-git-send-email-stefanbeller@googlemail.com","subject":"Re: [PATCH 1/2] refs: remove unused function invalidate_ref_cache","fromName":"Michael Haggerty","fromEmail":"mhagger@alum.mit.edu","sentAt":"2013-10-27T04:26:57Z","receivedAt":"2013-10-27T04:26:57Z","isPatch":true,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"On 10/26/2013 07:03 PM, Stefan Beller wrote:\n> The function 'invalidate_ref_cache' was introduced in 79c7ca5 (2011-10-17,\n> invalidate_ref_cache(): rename function from invalidate_cached_refs())\n> by a rename and elevated to be publicly usable in 8be8bde (2011-10-17,\n> invalidate_ref_cache(): expose this function in the refs API)\n> \n> However it is not used anymore, as 8bf90dc (2011-10-17, write_ref_sha1():\n> only invalidate the loose ref cache) and (much) later 506a760 (2013-04-22,\n> refs: change how packed refs are deleted) removed any calls to this\n> function. So it seems as if we don't need that function any more,\n> good bye!\n\nLooks good.  Stefan, thanks for cleaning up after me!\n\nMichael\n\n-- \nMichael Haggerty\nmhagger@alum.mit.edu\nhttp://softwareswirl.blogspot.com/\n"}]}