Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork939
Commit89ade7b
committed
Fix order of operators before executing the git command
Since Python 3.3, the hash value of an object is seeded randomly, making itchange between each call. As a consequence, the `dict` type relying on the hashvalue for the order of the items upon iterating on it, and the parameterspassed to `git` being passed as `kwargs` to the `execute()` method, the orderof parameters will change randomly between calls.For example, when you call `git.remote.pull()` in a code, two consecutives runwill generate:1. git pull --progress -v origin master2. git pull -v --progress origin masterWithin 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 theparameters in the same order.1 parentfb577c8 commit89ade7b
1 file changed
+3
-0
lines changedLines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| 16 | + | |
| 17 | + | |
16 | 18 |
| |
17 | 19 |
| |
18 | 20 |
| |
| |||
783 | 785 |
| |
784 | 786 |
| |
785 | 787 |
| |
| 788 | + | |
786 | 789 |
| |
787 | 790 |
| |
788 | 791 |
| |
|
0 commit comments
Comments
(0)