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)
 | 
					    return (committed, details)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def checkup_pushed():
 | 
					def checkup_pushed():
 | 
				
			||||||
    command = [GIT, 'rev-parse', '@']
 | 
					    command = [GIT, 'rev-parse', '@', '@{u}']
 | 
				
			||||||
    my_head = subprocess.check_output(command, stderr=subprocess.STDOUT)
 | 
					    output = subprocess.check_output(command, stderr=subprocess.STDOUT)
 | 
				
			||||||
    my_head = my_head.strip().decode()
 | 
					    (my_head, remote_head) = output.strip().decode().splitlines()
 | 
				
			||||||
 | 
					 | 
				
			||||||
    command = [GIT, 'rev-parse', '@{u}']
 | 
					 | 
				
			||||||
    remote_head = subprocess.check_output(command, stderr=subprocess.STDOUT)
 | 
					 | 
				
			||||||
    remote_head = remote_head.strip().decode()
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    command = [GIT, 'merge-base', '@', '@{u}']
 | 
					    command = [GIT, 'merge-base', '@', '@{u}']
 | 
				
			||||||
    merge_base = subprocess.check_output(command, stderr=subprocess.STDOUT)
 | 
					    merge_base = subprocess.check_output(command, stderr=subprocess.STDOUT)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue