From 9e48b389990c0201487e58f3bac32734a59a7e89 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 26 Oct 2005 01:41:20 +0200 Subject: 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 Signed-off-by: Junio C Hamano --- sha1_file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sha1_file.c') diff --git a/sha1_file.c b/sha1_file.c index e45679975..7fdc46969 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) { -- cgit v1.2.1