aboutsummaryrefslogtreecommitdiff
path: root/bpkg/fetch-git.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-02-14 00:38:22 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-02-15 12:12:23 +0300
commitfbc7f6db25c322ea0da0a13d080d07b84f8bc497 (patch)
treec321d0951c17d9d3b9e43ea19a4c5fee27f6e142 /bpkg/fetch-git.cxx
parente701a83e8d5d60a3cc3c5e285ddb1fe03d4a0aa5 (diff)
Make git_clone() to abbreviate (16 chars) commit id-based directory name
Diffstat (limited to 'bpkg/fetch-git.cxx')
-rw-r--r--bpkg/fetch-git.cxx8
1 files changed, 7 insertions, 1 deletions
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));