diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-08-13 18:01:50 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-08-26 11:36:35 +0200 |
commit | a312e71b59340f7b6d8dc5aac9202137ae81d02b (patch) | |
tree | 0601795d12487a2d8e4e87704f9592fd00e8bd08 /test/buildtool/file_system/git_repo.test.cpp | |
parent | d7f6ca59d2e2713efe40c96e2c6522f6d86180d2 (diff) | |
download | justbuild-a312e71b59340f7b6d8dc5aac9202137ae81d02b.tar.gz |
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.
Diffstat (limited to 'test/buildtool/file_system/git_repo.test.cpp')
-rw-r--r-- | test/buildtool/file_system/git_repo.test.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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); } |