git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] cache: remove unused function 'have_git_dir'

From
Stefan Beller <stefanbeller@googlemail.com>
Date
Oct 26, 2013, 17:03 UTC
Message-ID
<1382806982-20634-2-git-send-email-stefanbeller@googlemail.com>
In-Reply-To
<1382806982-20634-1-git-send-email-stefanbeller@googlemail.com>

This function was added in d2b0708 (2008-09-27, add have_git_dir() function) as a preparation for adbc0b6 (2008-09-30, cygwin: Use native Win32 API for stat).

However the second referenced commit was reverted in f66450a (2013-06-22, cygwin: Remove the Win32 l/stat() implementation), so we don't need to expose this wrapper function any more as a public API.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
---
 cache.h       | 1 -
 environment.c | 5 -----
 2 files changed, 6 deletions(-)
diff --git a/cache.h b/cache.h
index 464c8fb..7e98f9e 100644
--- a/cache.h
+++ b/cache.h
@@ -398,7 +398,6 @@ extern int is_bare_repository(void);
 extern int is_inside_git_dir(void);
 extern char *git_work_tree_cfg;
 extern int is_inside_work_tree(void);
-extern int have_git_dir(void);
 extern const char *get_git_dir(void);
 extern int is_git_directory(const char *path);
 extern char *get_object_directory(void);
diff --git a/environment.c b/environment.c
index 378254c..0a15349 100644
--- a/environment.c
+++ b/environment.c
@@ -155,11 +155,6 @@ int is_bare_repository(void)
 	return is_bare_repository_cfg && !get_git_work_tree();
 }
 
-int have_git_dir(void)
-{
-	return !!git_dir;
-}
-
 const char *get_git_dir(void)
 {
 	if (!git_dir)
-- 
1.8.4.1.605.g23c6912
Previous: Stefan BellerNext: Michael Haggerty
Message 2 of 3 in “refs: remove unused function invalidate_ref_cache”
  1. 1/2 refs: remove unused function invalidate_ref_cacheStefan Beller, Oct 26, 2013
  2. 2/2 cache: remove unused function 'have_git_dir'Stefan Beller, Oct 26, 2013
  3. Michael HaggertyOct 27, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.