def gitCommitId(path, ref):
 cmd = (gitCmdBase(path) + ['show', ref])
 try:
  output = runSubprocess(cmd, stderr=None, universal_newlines=True)
 except sp.CalledProcessError:
  print cmd
  raise NameError(("Unknown git reference '%s'" % ref))
 commit = output.split('\n')[0]
 assert (commit[:7] == 'commit ')
 return commit[7:]

def gitCommitId ( path , ref ) : cmd = ( gitCmdBase ( path ) + [ 'show' , ref ] ) try : output = runSubprocess ( cmd , stderr = None , universal_newlines = True ) except sp . CalledProcessError : print cmd raise NameError ( ( "Unknown git reference '%s'" % ref ) ) commit = output . split ( '\n' ) [ 0 ] assert ( commit [ : 7 ] == 'commit ' ) return commit [ 7 : ]
return the commit id of *ref* in the git repository at *path* .