Report actual attempted Git command when Git.refresh fails - #1812
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1809
Fixes #1811
This modifies
Git.refreshto report the attempted Git command rather than alwaysgiteven if a different command was used. This affects thecommandattribute of theGitCommandNotFoundexception, as well as (and automatically) the text displayed ascmdline:since that is from that attribute.It also expands and adds more tests of
git.refesh(which callsGit.refresh) to encompass this behavior, verifying that they fail before #1809 is fixed and pass afterwards, as well as verify some behavior that was already established but not yet under test.Since #1811 would otherwise be exacerbated by these changes, I've also made it so those tests roll back the global changes they make that may affect other test by calling
git.refresh()with no arguments. I believe this can be considered to fix that issue.There is a bit more information in the commit messages, including about why I've taken that approach to #1811, at least so far, rather than specifically capturing and restoring the pieces of state that are currently affected.
This PR also includes some minor refactoring and comment revision for readability in some code called by
git.refreshthat should make no behavioral change. This includes an improvement to the wording of the comment inGit.refreshdiscussed in review comments on #1810; the opportunity for this came closer than I'd predicted in #1810 (comment). (It might be possible to improve it further.)Edit: Corrected "some behavior that was not established" to "some behavior that was already established but not yet under test".