git: e15d22609c7d - main - mfc-candidates: Fix remote repo detection

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Wed, 12 Aug 2026 19:19:01 UTC
The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=e15d22609c7d91201cd32b3418c70dc176b95245

commit e15d22609c7d91201cd32b3418c70dc176b95245
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-08-12 18:28:39 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2026-08-12 18:29:48 +0000

    mfc-candidates: Fix remote repo detection
    
    In my repos the remote "freebsd" is git@gitrepo.freebsd.org:src.git.
    In particular, the last component is delimited by a colon, not a slash.
    
    Sponsored by:   Klara, Inc.
    Differential Revision: https://reviews.freebsd.org/D48951
---
 tools/tools/git/mfc-candidates.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tools/git/mfc-candidates.lua b/tools/tools/git/mfc-candidates.lua
index cbf7dcb3a257..0bf1a2f636bd 100755
--- a/tools/tools/git/mfc-candidates.lua
+++ b/tools/tools/git/mfc-candidates.lua
@@ -132,7 +132,7 @@ local function main()
 	local url = exec_command("git remote get-url freebsd 2>/dev/null")
 	local freebsd_repo
 	if url and url ~= "" then
-		freebsd_repo = string.match(url, "[^/]+$")
+		freebsd_repo = string.match(url, "[^:/]+$")
 		freebsd_repo = string.gsub(freebsd_repo, "%.git$", "")
 	end
 	if freebsd_repo == "ports" or freebsd_repo == "freebsd-ports" then