Skip to content

Commit

Permalink
Work around missing hard links on FAT formatted media
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Oct 26, 2005
1 parent 303958d commit 9e48b38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clone-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9e48b38

Please sign in to comment.