[PATCH] clone: Skip pack-*.keep files when cloning locally

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]