Skip to content
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

Fix order of operators before executing the git command #431

Merged
merged 1 commit into from
May 19, 2016

Commits on May 12, 2016

  1. Fix order of operators before executing the git command

    Since Python 3.3, the hash value of an object is seeded randomly, making it
    change between each call. As a consequence, the `dict` type relying on the hash
    value for the order of the items upon iterating on it, and the parameters
    passed to `git` being passed as `kwargs` to the `execute()` method, the order
    of parameters will change randomly between calls.
    
    For example, when you call `git.remote.pull()` in a code, two consecutives run
    will generate:
    
    1. git pull --progress -v origin master
    2. git pull -v --progress origin master
    
    Within the `transform_kwargs()` method, I'm promoting `kwargs` into an
    `collections.OrderedDict` being built with `kwargs` sorted on the keys.
    Then it will ensure that each subsequent calls will execute the
    parameters in the same order.
    guyzmo committed May 12, 2016
    Configuration menu
    Copy the full SHA
    89ade7b View commit details
    Browse the repository at this point in the history