proj/gagit:main commit in: test/, /
MichaŠGórny <[email protected]> Wed, 05 Aug 2026 15:03:36 +0000 (UTC)
| Newsgroups | gmane.linux.gentoo.cvs |
|---|---|
| Message-ID | <1785942201.d96118cd5e9be8be596b7edb662e63a4c04825e6.mgorny@gentoo> |
commit: d96118cd5e9be8be596b7edb662e63a4c04825e6
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 5 15:03:21 2026 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Aug 5 15:03:21 2026 +0000
URL: https://gitweb.gentoo.org/proj/gagit.git/commit/?id=d96118cd
Add a test for title/desc
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
meson.build | 1 +
test/25title-desc.sh | 25 +++++++++++++++++++++++++
2 files changed, 26 insertions(+)
diff --git a/meson.build b/meson.build
index 07345dc..199ffc5 100644
--- a/meson.build
+++ b/meson.build
@@ -26,6 +26,7 @@ tests = [
'22target-branches',
'23topic',
'24template',
+ '25title-desc',
]
foreach t : tests
diff --git a/test/25title-desc.sh b/test/25title-desc.sh
new file mode 100644
index 0000000..b14aa84
--- /dev/null
+++ b/test/25title-desc.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+# Test that -t and -d are respected.
+
+set -e -x
+
+. common-setup.sh
+repository_setup codeberg foo dev
+git commit --allow-empty -m "test commit
+
+test body"
+
+STDERR=$(bash "${INITDIR}"/../gagit -t 'custom title' -n 2>&1 >/dev/null)
+# T: custom title
+# D: test body
+[[ ${STDERR} == *"+ 'git' 'push' '-o' 'title={base64}Y3VzdG9tIHRpdGxlCg==' '-o' 'description={base64}dGVzdCBib2R5CgoKCgo='"* ]]
+
+STDERR=$(bash "${INITDIR}"/../gagit -d 'custom desc' -n 2>&1 >/dev/null)
+# T: WIP: test commit
+# D: custom desc
+[[ ${STDERR} == *"+ 'git' 'push' '-o' 'title={base64}V0lQOiB0ZXN0IGNvbW1pdAo=' '-o' 'description={base64}Y3VzdG9tIGRlc2MKCgoKCg=='"* ]]
+
+STDERR=$(bash "${INITDIR}"/../gagit -t 'custom title' -d 'custom desc' -n 2>&1 >/dev/null)
+# T: custom title
+# D: custom desc
+[[ ${STDERR} == *"+ 'git' 'push' '-o' 'title={base64}Y3VzdG9tIHRpdGxlCg==' '-o' 'description={base64}Y3VzdG9tIGRlc2MKCgoKCg=='"* ]]