def new_repo():
 path = qtutils.opendir_dialog(N_(u'New Repository...'), core.getcwd())
 if (not path):
  return None
 if (git.is_git_worktree(path) or git.is_git_dir(path)):
  return path
 (status, out, err) = core.run_command([u'git', u'init', path])
 if (status == 0):
  return path
 else:
  title = N_(u'Error Creating Repository')
  msg = (N_(u'"%(command)s" returned exit status %(status)d') % dict(command=(u'git init %s' % path), status=status))
  details = (N_(u'Output:\n%s') % out)
  if err:
   details += u'\n\n'
   details += (N_(u'Errors: %s') % err)
  qtutils.critical(title, msg, details)
  return None

def new_repo ( ) : path = qtutils . opendir_dialog ( N_ ( u'New Repository...' ) , core . getcwd ( ) ) if ( not path ) : return None if ( git . is_git_worktree ( path ) or git . is_git_dir ( path ) ) : return path ( status , out , err ) = core . run_command ( [ u'git' , u'init' , path ] ) if ( status == 0 ) : return path else : title = N_ ( u'Error Creating Repository' ) msg = ( N_ ( u'"%(command)s" returned exit status %(status)d' ) % dict ( command = ( u'git init %s' % path ) , status = status ) ) details = ( N_ ( u'Output:\n%s' ) % out ) if err : details += u'\n\n' details += ( N_ ( u'Errors: %s' ) % err ) qtutils . critical ( title , msg , details ) return None
prompt for a new directory and create a new git repository :returns str: repository path or none if no repository was created .