Skip to content
This repository has been archived by the owner on Aug 14, 2020. It is now read-only.

Commit

Permalink
Bug 1350104 - prevent incorrect diff matches due to +++,--- embedded …
Browse files Browse the repository at this point in the history
…in commit messages, r=gbrown.
  • Loading branch information
bclary committed Mar 31, 2017
1 parent c2f3fcd commit 73cd894
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions utils.py
Expand Up @@ -345,11 +345,16 @@ def get_changeset_dirs(changeset_url, max_changesets=32):
diff = get_remote_text(url)
if diff:
for line in diff.splitlines():
if line.find('/dev/null') != -1:
if line.startswith('#') or line.find('/dev/null') != -1:
continue
if line.startswith('+++') or line.startswith('---'):
if line.startswith('+++ b/') or line.startswith('--- a/'):
# skip markers, space and leading slash
path = os.path.dirname(line[6:])
# Note that if the changeset was due to a
# change in a top level file or tagging of a
# branch, then path will be empty which will
# result in all directory restricted tests
# running which is alright.
dirs_set.add(path)
else:
LOGGER.debug('get_changeset_dirs: Could not find diff for '
Expand Down

0 comments on commit 73cd894

Please sign in to comment.