git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] clone: Skip pack-*.keep files when cloning locally
@ 2013-06-28 14:42 Jens Lindstrom
  2013-06-28 18:38 ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Jens Lindstrom @ 2013-06-28 14:42 UTC (permalink / raw)
  To: git; +Cc: gitster, johan, Jens Lindstrom

The pack-*.keep files are temporary, and serve no purpose in the
clone.  They would probably also never be deleted from the clone if
copied, since the process that created them only expects to have to
delete them from the original repository.

Worse, though, they are created with access bits 0600, so if the
user trying to clone the repository is different from the user that
caused the pack-*.keep file to be created, the clone will likely
fail due to not being allowed to read (and thus copy) the file in
the first place.

Signed-off-by: Jens Lindstrom <jl@opera.com>
---
 builtin/clone.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/builtin/clone.c b/builtin/clone.c
index 035ab64..0ec0ec9 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -342,6 +342,11 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest,
 			continue;
 		}
 
+		/* Skip pack-*.keep files, they are temporary and not
+		   relevant to the clone, and might not be accessible. */
+		if (!strcmp(src->buf + strlen(src->buf) - 5, ".keep"))
+			continue;
+
 		/* Files that cannot be copied bit-for-bit... */
 		if (!strcmp(src->buf + src_baselen, "/info/alternates")) {
 			copy_alternates(src, dest, src_repo);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-07-03 18:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-28 14:42 [PATCH] clone: Skip pack-*.keep files when cloning locally Jens Lindstrom
2013-06-28 18:38 ` Junio C Hamano
2013-06-28 20:38   ` Junio C Hamano
2013-07-01 10:24   ` Jens Lindström
2013-07-01 16:20     ` Junio C Hamano
2013-07-03 10:02       ` Jens Lindström
2013-07-03 17:26         ` Junio C Hamano
2013-07-03 18:31           ` Jens Lindström

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).