X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=sha1_file.c;h=7fdc46969d718096f6492f08489ae20b9693c64b;hb=b5c367f75c2990650119749a1add5216871ca47a;hp=e45679975e7fcbfae0497f25ab56b6bbd0ff1155;hpb=29504118f8528f658fd0bfc02d8d78d4c01dc2cc;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) {