Skip to content

Dynamic repository location #399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

JakeGinnivan
Copy link
Contributor

No description provided.

var userTemp = Path.GetTempPath();
var repositoryName = targetUrl.EndsWith(".git") ?
targetUrl.Split('/', '\\').Last().Replace(".git", string.Empty) :
targetUrl.Split('/', '\\').Last();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would either use @GeertvanHorrik 's approach or:

var repositoryName = new Uri(targetUrl).Segments.Last();
repositoryName = Path.GetExtension(repositoryName).ToLowerInvariant() == ".git"
    ? Path.GetFileNameWithoutExtension(repositoryName)
    : repositoryName;

@JakeGinnivan
Copy link
Contributor Author

@eggapauli @GeertvanHorrik ok, I think I have fixed the issues pointed out.

if (Directory.Exists(gitRootDirectory))
try
{
using (var repository = new Repository(possiblePath))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure (haven't ran the code), but shouldn't we do a fetch first to check if there are new remotes (for example, for PR)?

JakeGinnivan added a commit that referenced this pull request Apr 6, 2015
@JakeGinnivan JakeGinnivan merged commit 55d6f2c into GitTools:master Apr 6, 2015
@JakeGinnivan JakeGinnivan deleted the DynamicRepositoryLocation branch April 6, 2015 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants