summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Johannes Schindelin <Johannes.Schindelin@gmx.de>2005-10-26 01:41:20 +0200
committerLibravatar Junio C Hamano <junkio@cox.net>2005-10-25 23:49:43 -0700
commit9e48b389990c0201487e58f3bac32734a59a7e89 (patch)
treedf8ff167b771bfe3058426f294729bfab21152ee
parentcreate_symref: if symlink fails, fall back to writing a "symbolic ref" (diff)
downloadtgif-9e48b389990c0201487e58f3bac32734a59a7e89.tar.xz
Work around missing hard links on FAT formatted media
FAT -- like Coda -- does not like cross-directory hard links. To be precise, FAT does not like links at all. But links are not needed either. So get rid of them. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r--clone-pack.c2
-rw-r--r--sha1_file.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/clone-pack.c b/clone-pack.c
index 4f4975b4ab..960921903e 100644
--- a/clone-pack.c
+++ b/clone-pack.c
@@ -211,7 +211,7 @@ static int clone_without_unpack(int fd[2])
ifd = fd[0];
snprintf(tmpfile, sizeof(tmpfile),
- "%s/pack-XXXXXX", get_object_directory());
+ "%s/pack/tmp-XXXXXX", get_object_directory());
ofd = mkstemp(tmpfile);
if (ofd < 0)
return error("unable to create temporary file %s", tmpfile);
diff --git a/sha1_file.c b/sha1_file.c
index e45679975e..7fdc46969d 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1239,11 +1239,14 @@ int move_temp_to_file(const char *tmpfile, char *filename)
* won't be able to check collisions, but that's not a
* big deal.
*
+ * The same holds for FAT formatted media.
+ *
* When this succeeds, we just return 0. We have nothing
* left to unlink.
*/
- if (ret == EXDEV && !rename(tmpfile, filename))
+ if ((ret == EXDEV || ret == ENOTSUP) && !rename(tmpfile, filename))
return 0;
+ ret = errno;
}
unlink(tmpfile);
if (ret) {