diff options
author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2022-04-07 10:49:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-07 10:49:02 +0800 |
commit | d5cee4a467a0ab543c0a118cc763ad3a54b8fc69 (patch) | |
tree | baeb3728921f7b2d4b0f5e3e45288870ab242ab8 /test | |
parent | 0b33576f8e7add5671f8927dff228e7f92eec076 (diff) | |
parent | 17b2b128fb6d6f987b47d60ccb1ab09b8fc238ea (diff) | |
download | gitpython-d5cee4a467a0ab543c0a118cc763ad3a54b8fc69.tar.gz |
Merge pull request #1423 from toku-sa-n/strip_newline_option
feat(cmd): add the `strip_newline` flag
Diffstat (limited to 'test')
-rw-r--r-- | test/test_repo.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test_repo.py b/test/test_repo.py index 6d617609..c5b2680d 100644 --- a/test/test_repo.py +++ b/test/test_repo.py @@ -1098,3 +1098,13 @@ class TestRepo(TestBase): except GitCommandError: pass self.assertEqual(r.currently_rebasing_on(), commitSpanish) + + @with_rw_directory + def test_do_not_strip_newline_in_stdout(self, rw_dir): + r = Repo.init(rw_dir) + fp = osp.join(rw_dir, 'hello.txt') + with open(fp, 'w') as fs: + fs.write("hello\n") + r.git.add(Git.polish_url(fp)) + r.git.commit(message="init") + self.assertEqual(r.git.show("HEAD:hello.txt", strip_newline_in_stdout=False), 'hello\n') |