1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-02 00:06:11 +02:00

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>
This commit is contained in:
Dmitry Potapov 2008-09-27 12:41:50 +04:00 committed by Shawn O. Pearce
parent 8b745e3ffd
commit d2b0708e1a
2 changed files with 6 additions and 0 deletions

View File

@ -313,6 +313,7 @@ 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 char *get_object_directory(void);
extern char *get_index_file(void);

View File

@ -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)