X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=sha1_file.c;h=7fdc46969d718096f6492f08489ae20b9693c64b;hb=9e48b389990c0201487e58f3bac32734a59a7e89;hp=e45679975e7fcbfae0497f25ab56b6bbd0ff1155;hpb=4ae22d96fe9248dac4f26b1fc91154ba5e879799;p=git.git diff --git a/sha1_file.c b/sha1_file.c index e4567997..7fdc4696 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) {