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

Commitf1b8d0c

Browse files
committed
Add a test for persistent git options
1 parent5b4f92c commitf1b8d0c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

‎git/cmd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
ifattr=='_version_info':

‎git/test/test_git.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
deftest_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
deftest_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')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp