File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -415,7 +415,7 @@ def set_persistent_git_options(self, **kwargs):
415415 """
416416
417417 self ._persistent_git_options = self .transform_kwargs (
418- split_single_char_options = True , ** kwargs )
418+ split_single_char_options = True , ** kwargs )
419419
420420 def _set_cache_ (self , attr ):
421421 if attr == '_version_info' :
Original file line number Diff line number Diff line change @@ -160,6 +160,20 @@ def test_options_are_passed_to_git(self):
160160 git_command_version = self .git .version ()
161161 self .assertEquals (git_version , git_command_version )
162162
163+ def test_persistent_options (self ):
164+ git_command_version = self .git .version ()
165+ # analog to test_options_are_passed_to_git
166+ self .git .set_persistent_git_options (version = True )
167+ git_version = self .git .NoOp ()
168+ self .assertEquals (git_version , git_command_version )
169+ # subsequent calls keep this option:
170+ git_version_2 = self .git .NoOp ()
171+ self .assertEquals (git_version_2 , git_command_version )
172+
173+ # reset to empty:
174+ self .git .set_persistent_git_options ()
175+ self .assertRaises (GitCommandError , self .git .NoOp )
176+
163177 def test_single_char_git_options_are_passed_to_git (self ):
164178 input_value = 'TestValue'
165179 output_value = self .git (c = 'user.name=%s' % input_value ).config ('--get' , 'user.name' )
You can’t perform that action at this time.
0 commit comments