diff --git a/conans/test/unittests/tools/scm/test_git_get_commit.py b/conans/test/unittests/tools/scm/test_git_get_commit.py index be652adc170..59b43e85955 100644 --- a/conans/test/unittests/tools/scm/test_git_get_commit.py +++ b/conans/test/unittests/tools/scm/test_git_get_commit.py @@ -71,6 +71,21 @@ def test_multi_folder_repo(): commit_real = str(c.out).splitlines()[0] assert commit_root == commit_real + # Relative paths for folders + git = Git(conanfile, folder="lib_a") + rel_commit_libA = git.get_commit() + + git = Git(conanfile, folder="./lib_b") + rel_commit_libB = git.get_commit() + + # this is folder default + git = Git(conanfile, folder=".") + rel_commit_root = git.get_commit() + + assert rel_commit_libA == commit_libA + assert rel_commit_libB == commit_libB + assert rel_commit_root == commit_root + # New commit in A c.save({"lib_a/conanfile.py": "CHANGED"}) c.run_command("git add .")