Skip to content

Commit

Permalink
add have_git_dir() function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Potapov authored and Shawn O. Pearce committed Sep 30, 2008
1 parent 8b745e3 commit d2b0708
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions environment.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d2b0708

Please sign in to comment.