From f7835a251c2c98df152792b15793b03e22bf078e Mon Sep 17 00:00:00 2001 From: Clemens Buchacher Date: Sat, 12 Sep 2009 11:03:48 +0200 Subject: preserve mtime of local clone A local clone without hardlinks copies all objects, including dangling ones, to the new repository. Since the mtimes are renewed, those dangling objects cannot be pruned by "git gc --prune", even if they would have been old enough for pruning in the original repository. Instead, preserve mtime during copy. "git gc --prune" will then work in the clone just like it did in the original. Signed-off-by: Clemens Buchacher Signed-off-by: Junio C Hamano --- builtin-clone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin-clone.c') diff --git a/builtin-clone.c b/builtin-clone.c index ad048085f3..bab2d84ea1 100644 --- a/builtin-clone.c +++ b/builtin-clone.c @@ -269,7 +269,7 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest) die_errno("failed to create link '%s'", dest->buf); option_no_hardlinks = 1; } - if (copy_file(dest->buf, src->buf, 0666)) + if (copy_file_with_time(dest->buf, src->buf, 0666)) die_errno("failed to copy file to '%s'", dest->buf); } closedir(dir); -- cgit v1.2.3