Skip to content

Commit

Permalink
Split project name from URI to its own param
Browse files Browse the repository at this point in the history
+semver:major
  • Loading branch information
josephmyers committed Sep 29, 2023
1 parent f49d876 commit ad42833
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/Chorus/UI/Clone/GetCloneFromInternetDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,21 @@ private void OnDownloadClick(object sender, EventArgs e)
StartClone();
}

public void StartClone(string username, string password, Uri targetUri)

/// <summary>
/// Starts a clone operation with the supplied information.
/// <param name="username">Username for Mercurial authentication</param>
/// <param name="password">Password for Mercurial authentication</param>
/// <param name="host">Host name (with scheme), e.g. https://www.google.com</param>
/// <param name="projectName">Name of the project to clone (will be combined with the host Uri)</param>
/// </summary>
public void StartClone(string username, string password, Uri host, string projectName)
{
_model.Username = username;
_model.Password = password;
_model.CustomUrl = targetUri.ToString();
_model.CustomUrl = new Uri(host, projectName).ToString();
_model.IsCustomUrl = true;
_model.LocalFolderName = GetProjectName(targetUri);
_model.LocalFolderName = projectName;

StartClone();
}
Expand All @@ -291,11 +299,6 @@ private void StartClone()
}
}

private string GetProjectName(Uri uri)
{
return uri.Segments[1].ToString();
}

public string ThreadSafeUrl
{
get;
Expand Down

0 comments on commit ad42833

Please sign in to comment.