-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
git.latest: add option to hard-reset only when there are remote changes #46854
Conversation
This allows for local changes to be discarded only when the repo is not already up-to-date.
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 just have a couple of really picky comments, otherwise this looks really nice and ++ for tests. :)
salt/modules/git.py
Outdated
Windows only. Required when specifying ``user``. This parameter will be | ||
ignored on non-Windows platforms. | ||
|
||
.. versionadded:: 2016.3.4 |
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.
If this whole function is new, then I don't think this versionadded
here is correct.
salt/modules/git.py
Outdated
If ``True``, do not log an error to the minion log if the git command | ||
returns a nonzero exit status. | ||
|
||
.. versionadded:: 2015.8.0 |
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.
Same comment here as above.
salt/modules/git.py
Outdated
be observed (i.e. the encoding specified by the locale will be | ||
tried first, and if that fails, UTF-8 will be used as a fallback). | ||
|
||
.. versionadded:: 2018.3.1 |
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.
Also probably not needed, I think. :)
This removes some versionadded/versionchanged lines that were unnecessary in a brand new function, but ended up there because of copypasta. It also updates the output_encoding documentation to match the updated docs from a recent PR that hasn't yet been merged from 2018.3 to develop.
@rallytime good catch, updated. Thanks! |
This adds a third potential value for the
force_reset
argument,'remote-changes'
which if used will not discard uncommitted changes unless the local clone is not up-to-date with the remote repository.Resolves #35888.