X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=path.c;h=066f62195508033a5f72504e4805ea436424296e;hb=ae41098714898acd52dba291e476a2fedbd2eae2;hp=bb89fb02dc9a8a1a09492fb32d8708f952afe47e;hpb=b467fb0b909883f28c4653361ccfa530ccf1a03e;p=git.git diff --git a/path.c b/path.c index bb89fb02d..066f62195 100644 --- a/path.c +++ b/path.c @@ -11,7 +11,6 @@ * which is what it's designed for. */ #include "cache.h" -#include static char bad_path[] = "/bad-path/"; @@ -279,7 +278,7 @@ int adjust_shared_perm(const char *path) : 0)); if (S_ISDIR(mode)) mode |= S_ISGID; - if (chmod(path, mode) < 0) + if ((mode & st.st_mode) != mode && chmod(path, mode) < 0) return -2; return 0; }