From b3ba8edd6068d0a9e119e310ae72e47e2f3e924a Mon Sep 17 00:00:00 2001
From: Leigh B Stoller <stoller@flux.utah.edu>
Date: Mon, 24 Jan 2022 09:23:59 -0700
Subject: [PATCH] Minor fix

---
 apt/gitrepo.proxy.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apt/gitrepo.proxy.in b/apt/gitrepo.proxy.in
index 29791b951d..a6ea882cbe 100644
--- a/apt/gitrepo.proxy.in
+++ b/apt/gitrepo.proxy.in
@@ -169,7 +169,7 @@ sub Clone()
     if (system("$GIT cat-file -e ${refspec}:.gitmodules") == 0) {
 	# Need the branch name for switch.
 	my $branch;
-	if ($refspec =~ /^refs\/heads\/(\w+)/) {
+	if ($refspec =~ /^refs\/heads\/([-\w]+)/ || $refspec =~ /^([-\w]+)$/) {
 	    $branch = $1;
 	}
 	else {
-- 
GitLab