aboutsummaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-11-01 15:09:55 -0800
committerJunio C Hamano <junkio@cox.net>2006-11-01 15:09:55 -0800
commit7854e526ff170846aef4ae3c71588c98ed9176d0 (patch)
treecccd87eb87799759e85f1a884668b60f1c2f3bf5 /sha1_file.c
parent1da1b3a3e06fdcbbd0b154a6930fc0261a5ee866 (diff)
parente23ed9a8b4769fcba0944cf121d366ec7db7fe3b (diff)
downloadgit-7854e526ff170846aef4ae3c71588c98ed9176d0.tar.gz
git-7854e526ff170846aef4ae3c71588c98ed9176d0.tar.xz
Merge branch 'maint'
* maint: pack-objects doesn't create random pack names link_temp_to_file: don't leave the path truncated on adjust_shared_perm failure
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c
index e89d24c01..570706919 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1400,8 +1400,10 @@ static int link_temp_to_file(const char *tmpfile, const char *filename)
if (dir) {
*dir = 0;
mkdir(filename, 0777);
- if (adjust_shared_perm(filename))
+ if (adjust_shared_perm(filename)) {
+ *dir = '/';
return -2;
+ }
*dir = '/';
if (!link(tmpfile, filename))
return 0;