Use plumbum a bit better.

This commit is contained in:
Anthony Sottile 2014-06-15 12:11:49 -07:00
parent 92aa55f44e
commit 7b1230df27
9 changed files with 44 additions and 44 deletions

View file

@ -30,8 +30,8 @@ def _update_repository(repo_config, runner):
repo = Repository.create(repo_config, runner.store)
with local.cwd(repo.repo_path_getter.repo_path):
local['git']['fetch']()
head_sha = local['git']['rev-parse', 'origin/master']().strip()
local['git']('fetch')
head_sha = local['git']('rev-parse', 'origin/master').strip()
# Don't bother trying to update if our sha is the same
if head_sha == repo_config['sha']:

View file

@ -49,21 +49,21 @@ def get_conflicted_files():
# This will get the rest of the changes made after the merge.
# If they resolved the merge conflict by choosing a mesh of both sides
# this will also include the conflicted files
tree_hash = local['git']['write-tree']().strip()
merge_diff_filenames = local['git'][
tree_hash = local['git']('write-tree').strip()
merge_diff_filenames = local['git'](
'diff', '-m', tree_hash, 'HEAD', 'MERGE_HEAD', '--name-only',
]().splitlines()
).splitlines()
return set(merge_conflict_filenames) | set(merge_diff_filenames)
@memoize_by_cwd
def get_staged_files():
return local['git']['diff', '--staged', '--name-only']().splitlines()
return local['git']('diff', '--staged', '--name-only').splitlines()
@memoize_by_cwd
def get_all_files():
return local['git']['ls-files']().splitlines()
return local['git']('ls-files').splitlines()
def get_files_matching(all_file_list_strategy):