diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2021-07-29 18:32:14 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-07-30 11:04:37 +0300 |
commit | 7490948f27d70df1f88ed161a2b758755d0a7929 (patch) | |
tree | 464099162afbf339c6cb502ba38d84ae0f9ced1e /bpkg/fetch-git.cxx | |
parent | aaf8e696886f443cd095ca7a5f37fc5b1ce0e207 (diff) |
Add support for checked out repository fragments caching
Diffstat (limited to 'bpkg/fetch-git.cxx')
-rw-r--r-- | bpkg/fetch-git.cxx | 29 |
1 files changed, 22 insertions, 7 deletions
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<bool> + 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<bool> git_fixup_worktree (const common_options& co, const dir_path& dir, - bool revert) + bool revert, + bool ie) { - optional<bool> r ( - fixup_worktree (co, dir, revert, dir_path () /* prefix */)); + try + { + optional<bool> 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 |