From: Johannes Schindelin Date: Fri, 3 Nov 2006 02:02:17 +0000 (-0800) Subject: link_temp_to_file: call adjust_shared_perm() only when we created the directory X-Git-Tag: v1.4.3.4~6 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=866cae0db4af936ec6f9eb6362e50db2a1a2f792;p=git-core%2Fgit.git link_temp_to_file: call adjust_shared_perm() only when we created the directory --- diff --git a/sha1_file.c b/sha1_file.c index 5fcad2893..27eb14b92 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -1382,8 +1382,7 @@ static int link_temp_to_file(const char *tmpfile, const char *filename) dir = strrchr(filename, '/'); if (dir) { *dir = 0; - mkdir(filename, 0777); - if (adjust_shared_perm(filename)) { + if (!mkdir(filename, 0777) && adjust_shared_perm(filename)) { *dir = '/'; return -2; }