From fbc7f6db25c322ea0da0a13d080d07b84f8bc497 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 14 Feb 2018 00:38:22 +0300 Subject: Make git_clone() to abbreviate (16 chars) commit id-based directory name --- bpkg/fetch-git.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'bpkg/fetch-git.cxx') diff --git a/bpkg/fetch-git.cxx b/bpkg/fetch-git.cxx index a60a160..a9a548e 100644 --- a/bpkg/fetch-git.cxx +++ b/bpkg/fetch-git.cxx @@ -919,7 +919,13 @@ namespace bpkg fetch_warn (cap, single_branch ? "branch" : "repository"); dir_path d (destdir); - d /= dir_path (ref.branch ? *ref.branch : *ref.commit); + + // Truncate commit id-based directory names to shorten the absolute + // directory path to lower probability of hitting the limit on Windows. + // Note that we can't do the same for branch/tag names as chances to clash + // would be way higher. Though such names are normally short anyway. + // + d /= dir_path (ref.branch ? *ref.branch : ref.commit->substr (0, 16)); strings to (timeout_opts (co, url.scheme)); -- cgit v1.1