Skip to content

Commit

Permalink
fixup! Builder: RepoUtils: Fix git checkouts and add test cli
Browse files Browse the repository at this point in the history
  • Loading branch information
Royna2544 committed Feb 22, 2025
1 parent f0f3b85 commit 12beaeb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/command_modules/builder/RepoUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void GitBranchSwitcher::removeOffendingConfig() const {
if (std::filesystem::exists(configPath)) {
git_config* config = nullptr;
DLOG(INFO) << "Config file found: " << configPath.string();
ret = git_config_open_ondisk(&config, configPath.c_str());
ret = git_config_open_ondisk(&config, configPath.string().c_str());
if (ret != 0) {
LOG(WARNING) << "Failed to open config file: "
<< git_error_last_str();
Expand Down Expand Up @@ -204,7 +204,7 @@ bool GitBranchSwitcher::open() {
// Init libgit2
git_libgit2_init();

ret = git_repository_open(data.repo, _gitDirectory.c_str());
ret = git_repository_open(data.repo, _gitDirectory.string().c_str());

if (ret != 0) {
LOG(ERROR) << "Failed to open repository: " << git_error_last_str();
Expand Down Expand Up @@ -636,7 +636,7 @@ bool RepoInfo::git_clone(const std::filesystem::path& directory,
}

git_libgit2_init();
int ret = ::git_clone(repo, url_.c_str(), directory.c_str(), &gitoptions);
int ret = ::git_clone(repo, url_.c_str(), directory.string().c_str(), &gitoptions);
if (ret != 0) {
const auto* fault = git_error_last();
LOG(ERROR) << "Couldn't clone repo: " << fault->message;
Expand Down

0 comments on commit 12beaeb

Please sign in to comment.