git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Lindstrom <jl@opera.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, johan@herland.net, Jens Lindstrom <jl@opera.com>
Subject: [PATCH] clone: Skip pack-*.keep files when cloning locally
Date: Fri, 28 Jun 2013 16:42:18 +0200	[thread overview]
Message-ID: <1372430538-19216-1-git-send-email-jl@opera.com> (raw)

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

             reply	other threads:[~2013-06-28 14:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-28 14:42 Jens Lindstrom [this message]
2013-06-28 18:38 ` [PATCH] clone: Skip pack-*.keep files when cloning locally 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1372430538-19216-1-git-send-email-jl@opera.com \
    --to=jl@opera.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johan@herland.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).