From 642c363d8d2da93db13cb8d183c2aa722cb5deff Mon Sep 17 00:00:00 2001
From: Marty Oehme <contact@martyoeh.me>
Date: Wed, 5 Mar 2025 22:00:41 +0100
Subject: [PATCH] Check diff to parent commit for non-merge commits

---
 .github/changed_templates.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/.github/changed_templates.sh b/.github/changed_templates.sh
index 5810e98..9be2141 100755
--- a/.github/changed_templates.sh
+++ b/.github/changed_templates.sh
@@ -35,6 +35,11 @@ esac
 
 base="$(git merge-base origin/HEAD "$tip")"
 
+# simply get parent for direct master-commits
+if [ "$base" = "$tip" ]; then
+    base="$(git rev-list -1 "$tip"~1)"
+fi
+
 echo "$base $tip" >/tmp/revisions
 
 /bin/echo -e '\x1b[32mChanged packages:\x1b[0m'