aboutsummaryrefslogtreecommitdiff
path: root/bpkg/fetch.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-04-13 23:38:12 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-04-19 19:39:55 +0300
commitf2f08e0758243a820fe47128ffabaa474c0e86e7 (patch)
tree45563c74dbbf7a0f546443b469a23541c9ac9b00 /bpkg/fetch.hxx
parente958b63712f9a0ff4b523765d2fe12b58aa97fe0 (diff)
Implement git repository handling transition (phase 0)
Diffstat (limited to 'bpkg/fetch.hxx')
-rw-r--r--bpkg/fetch.hxx42
1 files changed, 31 insertions, 11 deletions
diff --git a/bpkg/fetch.hxx b/bpkg/fetch.hxx
index e784cb6..9530455 100644
--- a/bpkg/fetch.hxx
+++ b/bpkg/fetch.hxx
@@ -49,21 +49,41 @@ namespace bpkg
// Repository type git (fetch-git.cxx).
//
- // Clone git repository into destdir/<name>/. Return the cloned repository
- // directory name that was deduced from the repository URL fragment.
+ // Create a git repository in the specified directory and prepare it for
+ // fetching from the specified repository location. Note that the repository
+ // URL fragment is neither used nor validated.
//
- dir_path
- git_clone (const common_options&,
- const repository_location&,
- const dir_path& destdir);
-
- // Fetch git repository in destdir/<name>/. Return the fetched repository
- // directory name that was deduced from the repository URL fragment.
+ void
+ git_init (const common_options&,
+ const repository_location&,
+ const dir_path&);
+
+ // Fetch a git repository in the specifid directory (previously created by
+ // git_init()) for the references obtained from the repository URL fragment
+ // returning commit ids these references resolve to. After fetching the
+ // repository working tree state is unspecified (see git_checkout ()).
//
- dir_path
+ // Note that submodules are not fetched.
+ //
+ strings
git_fetch (const common_options&,
const repository_location&,
- const dir_path& destdir);
+ const dir_path&);
+
+ // Checkout the specified commit previously fetched by git_fetch().
+ //
+ // Note that submodules are not checked out.
+ //
+ void
+ git_checkout (const common_options&,
+ const dir_path&,
+ const string& commit);
+
+ // Fetch (if necessary) and checkout submodules, recursively, in a working
+ // tree previously checked out by git_checkout().
+ //
+ void
+ git_checkout_submodules (const common_options&, const dir_path&);
// Low-level fetch API (fetch.cxx).
//