Skip to content

Commit

Permalink
link_temp_to_file: call adjust_shared_perm() only when we created the…
Browse files Browse the repository at this point in the history
… directory
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Nov 3, 2006
1 parent e23ed9a commit 866cae0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 866cae0

Please sign in to comment.