summaryrefslogtreecommitdiff
path: root/environment.c
diff options
context:
space:
mode:
authorDmitry Potapov <dpotapov@gmail.com>2008-09-27 12:41:50 +0400
committerShawn O. Pearce <spearce@spearce.org>2008-09-30 14:30:06 -0700
commitd2b0708e1a65953ad93a4adfc27938de0f8df252 (patch)
tree028921f8167158f6c03a44ce015c6f80fb2b2d53 /environment.c
parent8b745e3ffdabe6ef110dc064af46b0ba993941e0 (diff)
downloadgit-d2b0708e1a65953ad93a4adfc27938de0f8df252.tar.gz
add have_git_dir() function
This function is used to learn whether git_dir is already set up or not. It is necessary, because we want to read configuration in compat/cygwin.c Signed-off-by: Dmitry Potapov <dpotapov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'environment.c')
-rw-r--r--environment.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/environment.c b/environment.c
index 0c6d11f6a0..0693cd9a42 100644
--- a/environment.c
+++ b/environment.c
@@ -80,6 +80,11 @@ 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)