diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-02-10 22:47:57 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2018-02-10 22:48:06 +0100 |
commit | 16ae8338d9227ba9b06694c199e7aedec11d4ef5 (patch) | |
tree | 54351f5f33ff94aa1164912f5ee6d885cfb09565 | |
parent | d376b476b15359df460977a3e64c58811fab2c91 (diff) |
GitRepository: clone using specified branch
-rw-r--r-- | src/GitRepository.cpp | 5 | ||||
-rw-r--r-- | src/main.cpp | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/GitRepository.cpp b/src/GitRepository.cpp index 0a3b0a7..7818bdb 100644 --- a/src/GitRepository.cpp +++ b/src/GitRepository.cpp @@ -35,9 +35,12 @@ namespace sibs Result<bool> GitRepository::clone(GitDependency *gitDependency, const FileString &repoDirPath) { + // TODO: Use git dependency revision when cloning gitInit(); git_repository *repo; - int error = git_clone(&repo, gitDependency->url.c_str(), toUtf8(repoDirPath).c_str(), NULL); + git_clone_options options = GIT_CLONE_OPTIONS_INIT; + options.checkout_branch = gitDependency->branch.c_str(); + int error = git_clone(&repo, gitDependency->url.c_str(), toUtf8(repoDirPath).c_str(), &options); if(error != 0) return buildGitError(error, "Failed to clone git repository"); diff --git a/src/main.cpp b/src/main.cpp index f91929c..c0d02d5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -77,6 +77,8 @@ using namespace std::chrono; // TODO: Implement link-time-optimization which should be used if building with a certain optimization level (sibs build) +// TODO (bug): Fix issue where running sibs-build in a project that uses cmake wont build and run tests + #if OS_FAMILY == OS_FAMILY_POSIX #define ferr std::cerr #else |