(include_uncommitted=True)
return sorted([f for f in set(changed_files) if f])
Return the list of file changed in the current branch compared to `master`
Return the list of file changed in the current branch compared to `master`
Return the list of file changed in the current branch compared to master
def files_changed(include_uncommitted=True):
    """
    Return the list of file changed in the current branch compared to `master`
    """
    with chdir(get_root()):
        # Use `--name-status` to include moved files
        name_status_result = run_command('git diff --name-status origin/master...', capture='out')

    name_status_lines = name_status_result.stdout.splitlines()

    changed_files = []
    for l in name_status_lines:
        files = l.split('\t')[1:]  # skip first element representing the type of change
        changed_files.extend(files)

    if include_uncommitted:
        with chdir(get_root()):
            # Use `--name-only` to include uncommitted files
            name_only_result = run_command('git diff --name-only master', capture='out')
        name_only_lines = name_only_result.stdout.splitlines()
        changed_files.extend(name_only_lines)

    return sorted([f for f in set(changed_files) if f])
def files_changed ( include_uncommitted = True ) : with chdir ( get_root ( ) ) : # Use `--name-status` to include moved files name_status_result = run_command ( 'git diff --name-status origin/master...' , capture = 'out' ) name_status_lines = name_status_result . stdout . splitlines ( ) changed_files = [ ] for l in name_status_lines : files = l . split ( '\t' ) [ 1 : ] # skip first element representing the type of change changed_files . extend ( files ) if include_uncommitted : with chdir ( get_root ( ) ) : # Use `--name-only` to include uncommitted files name_only_result = run_command ( 'git diff --name-only master' , capture = 'out' ) name_only_lines = name_only_result . stdout . splitlines ( ) changed_files . extend ( name_only_lines ) return sorted ( [ f for f in set ( changed_files ) if f ] )