Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Make changed files less scared of progress in origin/master. #1238

Merged
merged 1 commit into from
Oct 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ def git_ls_dirs(root=None):
return list(dirs)


def git_changed_files(root=None, skip_nonexisting=True):
filenames = _git.diff('--name-only', 'origin/master').split('\n')
def git_changed_files(skip_nonexisting=True):
fork_point = _git.merge_base('--fork-point', 'origin/master').strip()
filenames = _git.diff('--name-only', fork_point).split('\n')
if skip_nonexisting:
filenames = [fn for fn in filenames if os.path.exists(fn)]
return filenames


if __name__ == '__main__':
from pprint import pprint
pprint(git_ls_dirs('parlai'))
pprint(git_changed_files('parlai'))