git-fsck-all: print output only on error
This commit is contained in:
parent
9dd752c9e5
commit
568b5924f3
1 changed files with 4 additions and 3 deletions
|
@ -31,8 +31,9 @@ def working_directory(directory):
|
||||||
|
|
||||||
for git_directory in git_directories('.'):
|
for git_directory in git_directories('.'):
|
||||||
with working_directory(git_directory):
|
with working_directory(git_directory):
|
||||||
print('\n{}:'.format(os.getcwd()))
|
try:
|
||||||
ret = subprocess.call(['git', 'fsck', '--no-dangling'])
|
subprocess.check_output(['git', 'fsck', '--no-dangling'], stderr=subprocess.STDOUT)
|
||||||
if ret != 0:
|
except subprocess.CalledProcessError as e:
|
||||||
print((Fore.RED + 'git fsck is unhappy with {}' + Fore.RESET)
|
print((Fore.RED + 'git fsck is unhappy with {}' + Fore.RESET)
|
||||||
.format(git_directory))
|
.format(git_directory))
|
||||||
|
print(e.output)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue