diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-09-09 01:27:07 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-09-09 09:27:45 -0700 |
commit | 90b4a71c493bf24f11b5edee8a519110624a6bea (patch) | |
tree | bc6b950d4b19ba1aee1292970571ad8744b1267b /rerere.c | |
parent | 10708a994a632c392ab58aa7d11e49b322aa1505 (diff) | |
download | git-90b4a71c493bf24f11b5edee8a519110624a6bea.tar.gz |
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.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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; |