From a312e71b59340f7b6d8dc5aac9202137ae81d02b Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Tue, 13 Aug 2024 18:01:50 +0200 Subject: GitRepo: Change logic that creates commits to explicitly give directory In preparation for subsequent changes, specify the directory path containing the tree content to be committed explicitly. This change will allow eventually to be able to specify paths that are different from the root path of the repository in which the commit is created. This commit renames and refactors StageAndCommitAllAnnonymous to allow a directory path to be passed. The just-mr and serve service logic is updated such that current behaviour is otherwise unchanged. --- src/other_tools/git_operations/git_operations.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/other_tools/git_operations/git_operations.cpp') diff --git a/src/other_tools/git_operations/git_operations.cpp b/src/other_tools/git_operations/git_operations.cpp index 8f5b7ad7..bfd1d18f 100644 --- a/src/other_tools/git_operations/git_operations.cpp +++ b/src/other_tools/git_operations/git_operations.cpp @@ -42,8 +42,9 @@ auto CriticalGitOps::GitInitialCommit(GitOpParams const& crit_op_params, fatal); }); // Stage and commit all at the target location - auto commit_hash = git_repo->StageAndCommitAllAnonymous( - crit_op_params.message.value(), wrapped_logger); + auto commit_hash = git_repo->CommitDirectory(crit_op_params.target_path, + crit_op_params.message.value(), + wrapped_logger); if (commit_hash == std::nullopt) { return {.git_cas = nullptr, .result = std::nullopt}; } -- cgit v1.2.3