summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-03-13 16:41:12 +0100
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-03-23 14:13:49 +0100
commitf60a95ef44ebedfe6859577420fb89f0c24b9663 (patch)
tree80266ed2ec1a93e6df5f429770e1e6d6cdc9cee4 /src
parent1ed993c81acb88110029358e407880639f3339ca (diff)
downloadjustbuild-f60a95ef44ebedfe6859577420fb89f0c24b9663.tar.gz
GitRepo: Make repository path usage explicit
Opening a repo should not check parent directories, only try to open at given path.
Diffstat (limited to 'src')
-rw-r--r--src/buildtool/file_system/git_repo.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/buildtool/file_system/git_repo.cpp b/src/buildtool/file_system/git_repo.cpp
index 1eed7eb7..7fb0bc76 100644
--- a/src/buildtool/file_system/git_repo.cpp
+++ b/src/buildtool/file_system/git_repo.cpp
@@ -297,7 +297,10 @@ GitRepo::GitRepo(std::filesystem::path const& repo_path) noexcept {
auto cas = std::make_shared<GitCAS>();
// open repo, but retain it
git_repository* repo_ptr{nullptr};
- if (git_repository_open(&repo_ptr, repo_path.c_str()) != 0) {
+ if (git_repository_open_ext(&repo_ptr,
+ repo_path.c_str(),
+ GIT_REPOSITORY_OPEN_NO_SEARCH,
+ nullptr) != 0) {
Logger::Log(LogLevel::Error,
"opening git repository {} failed with:\n{}",
repo_path.string(),