Read my_head and remote_head with a single subprocess call.
This commit is contained in:
parent
2bc3d4caa6
commit
1abe5a615b
1 changed files with 3 additions and 7 deletions
|
@ -50,13 +50,9 @@ def checkup_committed():
|
|||
return (committed, details)
|
||||
|
||||
def checkup_pushed():
|
||||
command = [GIT, 'rev-parse', '@']
|
||||
my_head = subprocess.check_output(command, stderr=subprocess.STDOUT)
|
||||
my_head = my_head.strip().decode()
|
||||
|
||||
command = [GIT, 'rev-parse', '@{u}']
|
||||
remote_head = subprocess.check_output(command, stderr=subprocess.STDOUT)
|
||||
remote_head = remote_head.strip().decode()
|
||||
command = [GIT, 'rev-parse', '@', '@{u}']
|
||||
output = subprocess.check_output(command, stderr=subprocess.STDOUT)
|
||||
(my_head, remote_head) = output.strip().decode().splitlines()
|
||||
|
||||
command = [GIT, 'merge-base', '@', '@{u}']
|
||||
merge_base = subprocess.check_output(command, stderr=subprocess.STDOUT)
|
||||
|
|
Loading…
Reference in a new issue