mirror of
https://github.com/git/git.git
synced 2024-11-24 18:33:43 +08:00
link_temp_to_file: call adjust_shared_perm() only when we created the directory
This commit is contained in:
parent
e23ed9a8b4
commit
866cae0db4
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user