From a2b084651909929d58f6b4bc0f3c742d87ee31f6 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 27 Apr 2018 15:53:00 +0300 Subject: Add support for repository fragments --- bpkg/fetch.hxx | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'bpkg/fetch.hxx') diff --git a/bpkg/fetch.hxx b/bpkg/fetch.hxx index d05b8da..9a8efd0 100644 --- a/bpkg/fetch.hxx +++ b/bpkg/fetch.hxx @@ -5,6 +5,8 @@ #ifndef BPKG_FETCH_HXX #define BPKG_FETCH_HXX +#include // time_t + #include #include @@ -60,15 +62,21 @@ namespace bpkg // Fetch a git repository in the specifid directory (previously created by // git_init() for the references obtained with the repository URL fragment - // filters, returning commit ids these references resolve to. After fetching - // the repository working tree state is unspecified (see git_checkout ()). + // filters, returning commit ids these references resolve to in the earliest + // to latest order. Update the remote repository URL, if changed. After + // fetching the repository working tree state is unspecified (see + // git_checkout()). // // Note that submodules are not fetched. // struct git_fragment { - string commit; - string name; // User-friendly name (like 'branch foo', 'tag bar', ...). + // User-friendly fragment name is either a ref (tags/v1.2.3, heads/master, + // HEAD) or an abbreviated commit id (0123456789ab). + // + string commit; + std::time_t timestamp; + string friendly_name; }; vector @@ -86,10 +94,13 @@ namespace bpkg const string& commit); // Fetch (if necessary) and checkout submodules, recursively, in a working - // tree previously checked out by git_checkout(). + // tree previously checked out by git_checkout(). Update the remote + // repository URL, if changed. // void - git_checkout_submodules (const common_options&, const dir_path&); + git_checkout_submodules (const common_options&, + const repository_location&, + const dir_path&); // Low-level fetch API (fetch.cxx). // -- cgit v1.1