diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2023-01-09 19:23:19 +0200 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2023-01-09 20:01:51 +0200 |
commit | 3c01e94cebda01041319903c8f5da382fcc96142 (patch) | |
tree | 415209a0d0bb0c1b14969a8ad603d720766af562 /tests | |
parent | ProvidedEclassInherit: new check for inheriting provided eclases (diff) | |
download | pkgcheck-3c01e94cebda01041319903c8f5da382fcc96142.tar.gz pkgcheck-3c01e94cebda01041319903c8f5da382fcc96142.tar.bz2 pkgcheck-3c01e94cebda01041319903c8f5da382fcc96142.zip |
git checks: include revision for old name during rename op
Previously it was including only the version without a revision, which
was failing and crashing the git check. This fixes it by including the
revision using the "fullver" property.
Include a reproducer test which fails without this commit and passes
with it.
Reported-by: Sam James <sam@gentoo.org>
Reported-by: David Seifert <soap@gentoo.org>
Resolves: https://github.com/pkgcore/pkgcheck/issues/511
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/checks/test_git.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/checks/test_git.py b/tests/checks/test_git.py index 1cefd549..0294f0b3 100644 --- a/tests/checks/test_git.py +++ b/tests/checks/test_git.py @@ -621,6 +621,35 @@ class TestGitPkgCommitsCheck(ReportTestCase): self.init_check() self.assertNoReport(self.check, self.source) + def test_revision_move(self): + self.parent_git_repo.move( + "cat/pkg/pkg-0.ebuild", + "cat/pkg/pkg-0-r1.ebuild", + msg="cat/pkg: some random fixes", + ) + self.parent_repo.create_ebuild("cat/newpkg-0-r1", keywords=["~amd64"]) + self.parent_git_repo.add_all("cat/newpkg: new package, v0") + + self.child_git_repo.run(["git", "pull", "origin", "main"]) + self.child_git_repo.run(["git", "remote", "set-head", "origin", "main"]) + + # moving revision version won't crash check + self.child_git_repo.move( + "cat/pkg/pkg-0-r1.ebuild", + "cat/pkg/pkg-0-r2.ebuild", + msg="cat/pkg: some extra random fixes", + signoff=True, + ) + self.child_git_repo.move( + "cat/newpkg/newpkg-0-r1.ebuild", + "cat/newpkg/newpkg-0-r2.ebuild", + msg="cat/newpkg: some random fixes", + signoff=True, + ) + + self.init_check() + self.assertNoReport(self.check, self.source) + class TestGitEclassCommitsCheck(ReportTestCase): |