Bug 1361972 - [mozlint] Add ability to only lint staged changes to --workdir with git r=standard8

MozReview-Commit-ID: DUxCKN2fiag
This commit is contained in:
Andrew Halberstadt
2017-06-30 18:29:31 -07:00
parent dcd0d62b03
commit 2f4b23a323
4 changed files with 30 additions and 10 deletions

View File

@@ -102,13 +102,18 @@ def test_vcs_helper(repo):
next(repo.setup)
assert_files(vcs.by_workdir(), ['bar', 'baz'])
assert_files(vcs.by_workdir('all'), ['bar', 'baz'])
if repo.vcs == 'git':
assert_files(vcs.by_workdir('staged'), ['baz'])
elif repo.vcs == 'hg':
assert_files(vcs.by_workdir('staged'), ['bar', 'baz'])
assert_files(vcs.by_outgoing(), [])
assert_files(vcs.by_outgoing(remotepath), [])
next(repo.setup)
assert_files(vcs.by_workdir(), [])
assert_files(vcs.by_workdir('all'), [])
assert_files(vcs.by_workdir('staged'), [])
assert_files(vcs.by_outgoing(), ['bar', 'baz'])
assert_files(vcs.by_outgoing(remotepath), ['bar', 'baz'])