proj/gagit:main commit in: /, test/

Michał Górny <[email protected]> Wed, 05 Aug 2026 14:52:11 +0000 (UTC)
Newsgroups gmane.linux.gentoo.cvs
Message-ID <1785941523.85128e566d2c511db904de691effb134079a9c46.mgorny@gentoo>
commit:     85128e566d2c511db904de691effb134079a9c46
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  5 14:52:03 2026 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Aug  5 14:52:03 2026 +0000
URL:        https://gitweb.gentoo.org/proj/gagit.git/commit/?id=85128e56

Add template test

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 meson.build        |  1 +
 test/24template.sh | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/meson.build b/meson.build
index 7b4474f..07345dc 100644
--- a/meson.build
+++ b/meson.build
@@ -25,6 +25,7 @@ tests = [
   '21remotes',
   '22target-branches',
   '23topic',
+  '24template',
 ]
 
 foreach t : tests

diff --git a/test/24template.sh b/test/24template.sh
new file mode 100644
index 0000000..34240b6
--- /dev/null
+++ b/test/24template.sh
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+# Test that templates are used.
+
+set -e -x
+
+. common-setup.sh
+repository_setup codeberg foo dev
+git commit --allow-empty -m "test commit"
+
+git checkout dev
+mkdir .github
+echo "github-style template" > .github/pull_request_template.md
+git add .github/pull_request_template.md
+git commit -m "add pr template"
+git checkout foo
+
+STDERR=$(bash "${INITDIR}"/../gagit -n 2>&1 >/dev/null)
+# D: github-style template
+[[ ${STDERR} == *"+ 'git' 'push' '-o' 'title={base64}V0lQOiB0ZXN0IGNvbW1pdAo=' '-o' 'description={base64}Z2l0aHViLXN0eWxlIHRlbXBsYXRlCgo="* ]]
+
+
+# forgejo template should take precedence
+git checkout dev
+mkdir .forgejo
+echo "forgejo-style template" > .forgejo/pull_request_template.md
+git add .forgejo/pull_request_template.md
+git commit -m "add another pr template"
+git checkout foo
+
+# D: forgejo-style template
+STDERR=$(bash "${INITDIR}"/../gagit -n 2>&1 >/dev/null)
+# D: github-style template
+[[ ${STDERR} == *"+ 'git' 'push' '-o' 'title={base64}V0lQOiB0ZXN0IGNvbW1pdAo=' '-o' 'description={base64}Zm9yZ2Vqby1zdHlsZSB0ZW1wbGF0ZQoK"* ]]