proj/gagit:main commit in: /

Michał Górny <[email protected]> Wed, 05 Aug 2026 11:34:22 +0000 (UTC)
Newsgroups gmane.linux.gentoo.cvs
Message-ID <1785928873.9e9636caefc74b1439564b6b322a4f10360d950a.mgorny@gentoo>
commit:     9e9636caefc74b1439564b6b322a4f10360d950a
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  5 11:21:13 2026 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Aug  5 11:21:13 2026 +0000
URL:        https://gitweb.gentoo.org/proj/gagit.git/commit/?id=9e9636ca

Silence the error if no branch

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

 gagit | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gagit b/gagit
index fecf812..268213d 100755
--- a/gagit
+++ b/gagit
@@ -211,7 +211,7 @@ main() {
 	[[ -z ${remote} ]] && die "Codeberg remote not found"
 	echo "Codeberg remote: ${remote}" >&2
 
-	local branch=$(git rev-parse --abbrev-ref HEAD)
+	local branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
 	echo "Current branch: ${branch}" >&2
 	case ${branch} in
 		HEAD|dev|main|master)