Commit bf7bd7e5 authored by Jelmer Vernooij's avatar Jelmer Vernooij

Don't consider an empty directory to be a pending change in a git

repository. Closes: #914038
parent a875ffe9
......@@ -4,6 +4,8 @@ lintian-brush (0.7) UNRELEASED; urgency=medium
* Add fixer for package-uses-deprecated-debhelper-compat-version
* Add support for fixing debhelper-but-no-misc-depends.
* Add a --diff option.
* Don't consider an empty directory to be a pending change in a git
repository. Closes: #914038
-- Jelmer Vernooij <jelmer@debian.org> Fri, 09 Nov 2018 21:07:23 +0000
......
......@@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 11),
dh-python,
dos2unix,
python3-all,
python3-breezy (>= 3.0.0~bzr7140),
python3-breezy (>= 3.0.0~bzr7199-1),
python3-breezy.tests,
python3-dulwich (>= 0.19.7),
python3-debian,
......@@ -18,7 +18,7 @@ Vcs-Browser: https://salsa.debian.org/jelmer/lintian-brush
Package: lintian-brush
Architecture: all
Depends: dos2unix,
python3-breezy (>= 3.0.0~bzr7140),
python3-breezy (>= 3.0.0~bzr7199-1),
python3-debian,
python3-dulwich (>= 0.19.7),
${misc:Depends},
......
......@@ -303,7 +303,7 @@ def run_lintian_fixer(local_tree, fixer, committer=None,
tuple with set of FixerResult, summary of the changes
"""
# Just check there are no changes to begin with
if list(local_tree.iter_changes(local_tree.basis_tree())):
if local_tree.has_changes():
raise PendingChanges(local_tree)
if list(local_tree.unknowns()):
raise PendingChanges(local_tree)
......
......@@ -121,6 +121,32 @@ Arch: all
tree, DummyFixer('dummy', 'some-tag'),
update_changelog=False)
def test_pending_changes_bzr_empty_dir(self):
# See https://bugs.debian.org/914038
tree = self.make_test_tree(format='bzr')
self.build_tree_contents([('debian/upstream/', )])
with tree.lock_write():
self.assertRaises(
PendingChanges, run_lintian_fixer,
tree, DummyFixer('dummy', 'some-tag'),
update_changelog=False)
def test_pending_changes_git_empty_dir(self):
# See https://bugs.debian.org/914038
tree = self.make_test_tree(format='git')
self.build_tree_contents([('debian/upstream/', )])
with tree.lock_write():
result, summary = run_lintian_fixer(
tree, DummyFixer('dummy', 'some-tag'),
update_changelog=False)
self.assertEqual(summary, "Fixed some tag.")
self.assertEqual(['some-tag'], result.fixed_lintian_tags)
self.assertEqual('certain', result.certainty)
self.assertEqual(2, tree.branch.revno())
self.assertEqual(
tree.get_file_lines('debian/control')[-1],
b"a new line\n")
def test_extra(self):
tree = self.make_test_tree()
self.build_tree_contents([('debian/foo', 'blah')])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment