Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbdd4210

Browse files
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 masterBy simply adding the `sorted()` call around `args` within the `transform_kwargs()`method, it will ensure that each subsequent calls will execute the parameters inthe same order.
1 parentfb577c8 commitbdd4210

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎git/cmd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ def transform_kwargs(self, split_single_char_options=True, **kwargs):
789789
args+=self.transform_kwarg(k,value,split_single_char_options)
790790
else:
791791
args+=self.transform_kwarg(k,v,split_single_char_options)
792-
returnargs
792+
returnsorted(args)
793793

794794
@classmethod
795795
def__unpack_args(cls,arg_list):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp