-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix publish form not getting hidden after publishing is done #79
Conversation
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.
This is not strictly required, but might as well.
Hmm, build is broken. Also, could this be broken up into smaller PRs or is this all logically the same fix? |
I broke some of the tests I recently added for the SimpleRepositoryModel because I changed how arguments get validated, and I was too tired to fix it up last night, fixing today. |
442c51e
to
f6a1273
Compare
IGitRepositoryInfo is a VS type that doesn't cache url information. Switch to our ISimpleRepositoryModel which caches the local and remote information and that we can control.
f6a1273
to
6559c03
Compare
Now that ActiveRepo is a SimpleRepositoryModel, we need a way to update the url, for when a user adds or removes the origin remote manually inside Visual Studio (in the git repo settings), or via the command line. This is required so that the UI updates properly and rechecks whether the repo is ours or not.
If the origin remote url changes, update ActiveRepo that as soon as possible.
028abe6
to
7dd53df
Compare
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.
FWIW, this comparison is the actual fix to #48.
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.
Wouldn't NullGuard.Fody
catch this? If not, you could use the nameof
operator here: throw new ArgumentNullException(nameof(path));
Yay C# 6!
Fix publish form not getting hidden after publishing is done
Fixes #48
This PR grew a bit more than I expected. The main fix is that we were only looking at the local path to see if VS had loaded a new repository, but it turns out that when you publish a repository, the url change also needs to be monitored so the UI is updated accordingly. This required some changes to how repositories are compared (via SimpleRepositoryModel) and how changes to the active repo are tracked.
This led to having ISimpleRepositoryModel be used everywhere instead of using IGitRepositoryInfo, so we can compare things better.