aboutsummaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2006-11-02 18:02:17 -0800
committerJunio C Hamano <junkio@cox.net>2006-11-02 18:02:17 -0800
commit866cae0db4af936ec6f9eb6362e50db2a1a2f792 (patch)
tree975f497d5ee0060c05a32a15ba1158b206dcaa6b /sha1_file.c
parente23ed9a8b4769fcba0944cf121d366ec7db7fe3b (diff)
downloadgit-866cae0db4af936ec6f9eb6362e50db2a1a2f792.tar.gz
git-866cae0db4af936ec6f9eb6362e50db2a1a2f792.tar.xz
link_temp_to_file: call adjust_shared_perm() only when we created the directory
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c3
1 files changed, 1 insertions, 2 deletions
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;
}