aboutsummaryrefslogtreecommitdiff
path: root/rerere.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-09-09 01:27:07 -0700
committerJunio C Hamano <gitster@pobox.com>2008-09-09 09:27:45 -0700
commit90b4a71c493bf24f11b5edee8a519110624a6bea (patch)
treebc6b950d4b19ba1aee1292970571ad8744b1267b /rerere.c
parent10708a994a632c392ab58aa7d11e49b322aa1505 (diff)
downloadgit-90b4a71c493bf24f11b5edee8a519110624a6bea.tar.gz
git-90b4a71c493bf24f11b5edee8a519110624a6bea.tar.xz
is_directory(): a generic helper function
A simple "grep -e stat --and -e S_ISDIR" revealed there are many open-coded implementations of this function. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'rerere.c')
-rw-r--r--rerere.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/rerere.c b/rerere.c
index 323e493da..c38886b22 100644
--- a/rerere.c
+++ b/rerere.c
@@ -319,7 +319,6 @@ static int git_rerere_config(const char *var, const char *value, void *cb)
static int is_rerere_enabled(void)
{
- struct stat st;
const char *rr_cache;
int rr_cache_exists;
@@ -327,7 +326,7 @@ static int is_rerere_enabled(void)
return 0;
rr_cache = git_path("rr-cache");
- rr_cache_exists = !stat(rr_cache, &st) && S_ISDIR(st.st_mode);
+ rr_cache_exists = is_directory(rr_cache);
if (rerere_enabled < 0)
return rr_cache_exists;