From 7490948f27d70df1f88ed161a2b758755d0a7929 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 29 Jul 2021 18:32:14 +0300 Subject: Add support for checked out repository fragments caching --- bpkg/fetch-git.cxx | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'bpkg/fetch-git.cxx') diff --git a/bpkg/fetch-git.cxx b/bpkg/fetch-git.cxx index 0c2ac21..8195375 100644 --- a/bpkg/fetch-git.cxx +++ b/bpkg/fetch-git.cxx @@ -2152,9 +2152,13 @@ namespace bpkg // Noop on POSIX. // - bool - git_fixup_worktree (const common_options&, const dir_path&, bool) + optional + git_fixup_worktree (const common_options&, + const dir_path&, + bool revert, + bool) { + assert (!revert); return false; } @@ -2545,15 +2549,26 @@ namespace bpkg return r; } - bool + optional git_fixup_worktree (const common_options& co, const dir_path& dir, - bool revert) + bool revert, + bool ie) { - optional r ( - fixup_worktree (co, dir, revert, dir_path () /* prefix */)); + try + { + optional r ( + fixup_worktree (co, dir, revert, dir_path () /* prefix */)); - return r ? *r : false; + return r ? *r : false; + } + catch (const failed&) + { + if (ie) + return nullopt; + + throw; + } } #endif -- cgit v1.1