Code

rerere: make sure it works even in a workdir attached to a young repository
[git.git] / rerere.c
index a59f74f76c293efa783103eaf3d167c97b3768ea..2d8de616347bae80e03cd7dd09bf2dd475ab3e59 100644 (file)
--- a/rerere.c
+++ b/rerere.c
@@ -522,8 +522,7 @@ static int is_rerere_enabled(void)
        if (rerere_enabled < 0)
                return rr_cache_exists;
 
-       if (!rr_cache_exists &&
-           (mkdir(rr_cache, 0777) || adjust_shared_perm(rr_cache)))
+       if (!rr_cache_exists && mkdir_in_gitdir(rr_cache))
                die("Could not create directory %s", rr_cache);
        return 1;
 }