Skip to content

Commit

Permalink
contrib: Fix remote repo detection for .git suffix
Browse files Browse the repository at this point in the history
Michi pointed out that the previous iteration on this regex fixed
security remotes but broke remotes with a URL ending in ".git". Enhance
the regex to also solve this case.

Reported-by: Michi Mutsuzaki <[email protected]>
Signed-off-by: Joe Stringer <[email protected]>
  • Loading branch information
joestringer authored and ldelossa committed Sep 19, 2023
1 parent 300b297 commit 7e9e82d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/backporting/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ get_remote () {
local org=${1:-cilium}
local repo=${2:-cilium}
remote=$(git remote -v | \
grep "github.com[/:]${org}/${repo} " | \
grep "github.com[/:]${org}/${repo}\(\.git\)\? " | \
head -n1 | cut -f1)
if [ -z "$remote" ]; then
echo "No remote [email protected]:${org}/${repo}.git or https://github.com/${org}/${repo} found" 1>&2
Expand Down

0 comments on commit 7e9e82d

Please sign in to comment.