diff options
author | Ruud van Asseldonk <ruud@chorus.one> | 2022-06-24 18:28:55 +0200 |
---|---|---|
committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2022-06-25 10:27:13 +0800 |
commit | f6523c15af935066b813c385b3cd8ff010001c01 (patch) | |
tree | 7d5a697f06d881aeb798c991416ddd4d37fba43d | |
parent | f0c6e1164f390081a27de952552aa83d34035f2a (diff) | |
download | gitpython-f6523c15af935066b813c385b3cd8ff010001c01.tar.gz |
Add regression test for TagReference.create
If you pass the "message" kwarg, it also translates it to an -m command
line flag, and with both -m and --message, the message appears twice.
I will fix this in the next commit.
-rw-r--r-- | test/test_refs.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_refs.py b/test/test_refs.py index 605648b0..5bb83100 100644 --- a/test/test_refs.py +++ b/test/test_refs.py @@ -572,6 +572,23 @@ class TestRefs(TestBase): # END for each path + @with_rw_repo("0.1.6") + def test_tag_message(self, rw_repo): + tag_ref = TagReference.create(rw_repo, "test-message-1", message="test") + assert tag_ref.tag.message == "test" + + tag_ref = TagReference.create(rw_repo, "test-message-2", logmsg="test") + assert tag_ref.tag.message == "test" + + tag_ref = TagReference.create( + rw_repo, + "test-message-3", + # Logmsg should take precedence over "message". + message="test1", + logmsg="test2", + ) + assert tag_ref.tag.message == "test2" + def test_dereference_recursive(self): # for now, just test the HEAD assert SymbolicReference.dereference_recursive(self.rorepo, "HEAD") |