summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 689ef4d)
raw | patch | inline | side by side (parent: 689ef4d)
author | Daniel Barkalow <barkalow@iabervon.org> | |
Tue, 20 May 2008 18:15:14 +0000 (14:15 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 21 May 2008 18:11:58 +0000 (11:11 -0700) |
Note that it stops trying hardlinks if any fail.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-clone.c | patch | blob | history |
diff --git a/builtin-clone.c b/builtin-clone.c
index 8936a51810fb4d1886187bc00507edc0287198f4..2a3f6732f2a233c17a0086628ff3c31319bfe8ac 100644 (file)
--- a/builtin-clone.c
+++ b/builtin-clone.c
if (unlink(dest) && errno != ENOENT)
die("failed to unlink %s\n", dest);
- if (option_no_hardlinks) {
- if (copy_file(dest, src, 0666))
- die("failed to copy file to %s\n", dest);
- } else {
- if (link(src, dest))
+ if (!option_no_hardlinks) {
+ if (!link(src, dest))
+ continue;
+ if (option_local)
die("failed to create link %s\n", dest);
+ option_no_hardlinks = 1;
}
+ if (copy_file(dest, src, 0666))
+ die("failed to copy file to %s\n", dest);
}
closedir(dir);
}