diff options
-rw-r--r-- | src/pkgcheck/addons/git.py | 2 | ||||
-rw-r--r-- | tests/checks/test_git.py | 29 |
2 files changed, 30 insertions, 1 deletions
diff --git a/src/pkgcheck/addons/git.py b/src/pkgcheck/addons/git.py index 26c1d06d..9fd016ce 100644 --- a/src/pkgcheck/addons/git.py +++ b/src/pkgcheck/addons/git.py @@ -280,7 +280,7 @@ class _GitCommitPkg(cpv.VersionedCPV): self.old.category, self.old.package, self.status, - self.old.version, + self.old.fullver, self.time, self.commit, ) 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): |