Skip to content

Commit

Permalink
Update conans/test/unittests/tools/scm/test_git_get_commit.py
Browse files Browse the repository at this point in the history
Test that relative folder paths work
  • Loading branch information
nmasseyKM committed Jun 6, 2022
1 parent a42d8f4 commit 57f879a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions conans/test/unittests/tools/scm/test_git_get_commit.py
Expand Up @@ -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 .")
Expand Down

0 comments on commit 57f879a

Please sign in to comment.