From 35c13620a1179ec566b361241ac0a097ebb0bc34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dundar=20G=C3=B6c?= Date: Thu, 14 Oct 2021 10:13:56 +0200 Subject: [PATCH] ci: allow older git versions when using lintcommit More specifically, use "git rev-parse --abbrev-ref HEAD" instead of "git branch --show-current" to get current branch. --- scripts/lintcommit.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lintcommit.lua b/scripts/lintcommit.lua index 98f9da246c..c30a1b10da 100644 --- a/scripts/lintcommit.lua +++ b/scripts/lintcommit.lua @@ -106,7 +106,7 @@ end function M.main(opt) _trace = not opt or not not opt.trace - local branch = run({'git', 'branch', '--show-current'}, true) + local branch = run({'git', 'rev-parse', '--abbrev-ref', 'HEAD'}, true) -- TODO(justinmk): check $GITHUB_REF local ancestor = run({'git', 'merge-base', 'origin/master', branch}) if not ancestor then