-
Notifications
You must be signed in to change notification settings - Fork 656
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
Dynamic repository location #399
Conversation
var userTemp = Path.GetTempPath(); | ||
var repositoryName = targetUrl.EndsWith(".git") ? | ||
targetUrl.Split('/', '\\').Last().Replace(".git", string.Empty) : | ||
targetUrl.Split('/', '\\').Last(); |
There was a problem hiding this comment.
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;
…, not git dir), and no longer delete dynamic repo once done.
@eggapauli @GeertvanHorrik ok, I think I have fixed the issues pointed out. |
if (Directory.Exists(gitRootDirectory)) | ||
try | ||
{ | ||
using (var repository = new Repository(possiblePath)) |
There was a problem hiding this comment.
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)?
Dynamic repository location
No description provided.