Exemplo n.º 1
0
 // ssh://brock.lee:password@localhost:29418/projects/brocklee-gatescheduler.git
 // ssh://dcs-system:design@localhost:29418/projects/brocklee-gatescheduler.git
 // https://admin:admin@localhost:8443/r/projects/brocklee-gatescheduler.git/
 public string GetRepoUrl(string repo, IScmUser user, bool embedPassword)
 {
     if (!repo.EndsWith(".git", StringComparison.OrdinalIgnoreCase))
     {
         repo += ".git";
     }
     var gitSettings = _settings.Git;
     return string.Format("{0}://{1}{2}@{3}/{4}/{5}",
         gitSettings.Protocol,
         user.Username,
         embedPassword ? ":" + user.Password : null,
         gitSettings.ServerPublic,
         gitSettings.ProjectsPath,
         repo);
 }
 public bool SetUser(string dir, IScmUser user)
 {
     return Git(string.Format("config user.name \"{0}\"", user.Username), dir)
         && Git(string.Format("config user.email \"{0}\"", user.Email), dir);
 }