def find_git_http_backend():
 if hasattr(find_git_http_backend, 'result'):
  return find_git_http_backend.result
 try:
  path = subprocess.check_output(['git', '--exec-path']).decode('utf-8')
  if path:
   GIT_PATHS.insert(0, path)
 except OSError:
  pass
 for path in GIT_PATHS:
  name = os.path.join(path, 'git-http-backend')
  if os.path.exists(name):
   find_git_http_backend.result = name
   return name

def find_git_http_backend ( ) : if hasattr ( find_git_http_backend , 'result' ) : return find_git_http_backend . result try : path = subprocess . check_output ( [ 'git' , '--exec-path' ] ) . decode ( 'utf-8' ) if path : GIT_PATHS . insert ( 0 , path ) except OSError : pass for path in GIT_PATHS : name = os . path . join ( path , 'git-http-backend' ) if os . path . exists ( name ) : find_git_http_backend . result = name return name
finds git http backend .