From f2df73b317a4e2834037be8b67084bee0b533bfe Mon Sep 17 00:00:00 2001 From: Eric Brunson Date: Wed, 23 Apr 2014 11:13:54 -0600 Subject: add git command options Add __call__ method to Git object to allow passing git command options to the executable requires flag to transform_kwargs add unit test Change-Id: If1bc01008e66d3fd3811c15b56e58f38c95b9887 --- git/test/test_git.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'git/test/test_git.py') diff --git a/git/test/test_git.py b/git/test/test_git.py index b61a0eea..e39c9575 100644 --- a/git/test/test_git.py +++ b/git/test/test_git.py @@ -107,3 +107,15 @@ class TestGit(TestBase): finally: type(self.git).GIT_PYTHON_GIT_EXECUTABLE = prev_cmd #END undo adjustment + + def test_options_are_passed_to_git(self): + # This work because any command after git --version is ignored + git_version = self.git(version=True).NoOp() + git_command_version = self.git.version() + self.assertEquals(git_version, git_command_version) + + def test_single_char_git_options_are_passed_to_git(self): + input_value='TestValue' + output_value = self.git(c='user.name={}'.format(input_value)).config('--get', 'user.name') + self.assertEquals(input_value, output_value) + -- cgit v1.2.1 From f5ec638a77dd1cd38512bc9cf2ebae949e7a8812 Mon Sep 17 00:00:00 2001 From: Eric Brunson Date: Wed, 23 Apr 2014 11:13:54 -0600 Subject: add git command options Add __call__ method to Git object to allow passing git command options to the executable requires flag to transform_kwargs add unit tests Change-Id: If1bc01008e66d3fd3811c15b56e58f38c95b9887 --- git/test/test_git.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'git/test/test_git.py') diff --git a/git/test/test_git.py b/git/test/test_git.py index e39c9575..e67cb92b 100644 --- a/git/test/test_git.py +++ b/git/test/test_git.py @@ -119,3 +119,5 @@ class TestGit(TestBase): output_value = self.git(c='user.name={}'.format(input_value)).config('--get', 'user.name') self.assertEquals(input_value, output_value) + def test_change_to_transform_kwargs_does_not_break_command_options(self): + self.git.log(n=1) -- cgit v1.2.1