1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-01 21:46:10 +02:00

link_temp_to_file: call adjust_shared_perm() only when we created the directory

This commit is contained in:
Johannes Schindelin 2006-11-02 18:02:17 -08:00 committed by Junio C Hamano
parent e23ed9a8b4
commit 866cae0db4

View File

@ -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;
}