projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix cloning (memory corruption)
[git.git]
/
sha1_file.c
diff --git
a/sha1_file.c
b/sha1_file.c
index
e456799
..
7fdc469
100644
(file)
--- 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.
*
* 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.
*/
* 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;
return 0;
+ ret = errno;
}
unlink(tmpfile);
if (ret) {
}
unlink(tmpfile);
if (ret) {