Closed starcraftman closed 6 years ago
Possible improvement, parse git status --porcelain only once. Something similar to below.
# TODO: Use porcelain for status, saves two commands # conflicts = 0 # untracked = 0 # staged = 0 # changed = 0 # for line in run_cmd(['git', 'status', '--porcelain']).splitlines(): # if line[0] in ['A', 'M']: # changed += 1 # if line[0] in ['A', 'M']: # staged += 1 # if line[0:2] == '??': # untracked += 1
Note there may be a double counting of conflicts/changed. Investigate and make a test case to cover.
Possible improvement, parse git status --porcelain only once. Something similar to below.