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
#11 - .git directory handling #15
Conversation
…fault directory picker to the user's My Documents folder.
…to the starting one if they browse for another repository.
var folderName = Path.GetDirectoryName(path) ?? ""; | ||
if (folderName.Equals(".git", StringComparison.OrdinalIgnoreCase)) | ||
//If we are passed a .git directory, just return it straightaway | ||
if (path.EndsWith(".git", StringComparison.OrdinalIgnoreCase)) |
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.
Probably better to use the path methods here. For example, in theory it could get a path with a trailing slash (though not sure if that'll actually happen).
Path.GetFolderName(path)
Or something like that should do the trick. :)
Apart from the one change I suggested, this looks great. Thanks! I'm going to merge it in now anyways. |
I forgot to comment on your question. If I understand correctly, the sequence is:
If so, that's definitely a bug. When we use the folder browser to select a folder, we should dispose all previous file monitors. |
Thanks Phil, I'll make that change tonight and that sequence is correct. Presumably to cancel the file monitors you need to hold on to the IDisposable that is returned from Subscribe and then call Dispose? |
Yeah, it looks that way. On Tue, Mar 20, 2012 at 12:08 AM, Chris Way <
|
haacked#15. Using DirectoryInfo as Path doesn't have a simple way of grabbing the last dir in a path.
…ifferent directory as per discussion in haacked#15.
Added handling if the user selects a .git directory and also default to the user's My Documents folder when first choosing "Browse Repository".
How should the case be handled if the user selects a non git directory (so monitoring is started), changes to a .git directory and then creates a git repo in the original dir that is being monitored? Currently the graph will switch back the monitored dir, not likely to happen but you never know! Should the monitoring be aborted when choosing an existing git repo or is the current behavior correct?