File tree 2 files changed +15
-1
lines changed
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):
415
415
"""
416
416
417
417
self ._persistent_git_options = self .transform_kwargs (
418
- split_single_char_options = True , ** kwargs )
418
+ split_single_char_options = True , ** kwargs )
419
419
420
420
def _set_cache_ (self , attr ):
421
421
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):
160
160
git_command_version = self .git .version ()
161
161
self .assertEquals (git_version , git_command_version )
162
162
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
+
163
177
def test_single_char_git_options_are_passed_to_git (self ):
164
178
input_value = 'TestValue'
165
179
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