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. --- test/buildtool/file_system/git_repo.test.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/buildtool/file_system/git_repo.test.cpp') diff --git a/test/buildtool/file_system/git_repo.test.cpp b/test/buildtool/file_system/git_repo.test.cpp index 969f2072..5a0831cc 100644 --- a/test/buildtool/file_system/git_repo.test.cpp +++ b/test/buildtool/file_system/git_repo.test.cpp @@ -182,7 +182,7 @@ TEST_CASE("Single-threaded real repository local operations", "[git_repo]") { std::string(msg)); }); - SECTION("Stage and commit all") { + SECTION("Commit directory") { // make blank repo auto repo_commit_path = TestUtils::GetRepoPath(); auto repo_commit = @@ -196,9 +196,9 @@ TEST_CASE("Single-threaded real repository local operations", "[git_repo]") { REQUIRE(FileSystemManager::WriteFile( "test no 2", repo_commit_path / "test2.txt", true)); - // stage and commit all - auto commit = - repo_commit->StageAndCommitAllAnonymous("test commit", logger); + // commit subdir + auto commit = repo_commit->CommitDirectory( + repo_commit_path, "test commit", logger); CHECK(commit); } -- cgit v1.2.3