bd sync: 2025-11-09 14:53:59
This commit is contained in:
@@ -322,9 +322,9 @@ func TestExtractIssuePrefix(t *testing.T) {
|
||||
expected: "bd",
|
||||
},
|
||||
{
|
||||
name: "hyphenated prefix",
|
||||
name: "multi-part suffix",
|
||||
issueID: "alpha-beta-1",
|
||||
expected: "alpha-beta",
|
||||
expected: "alpha", // Only first hyphen (bd-fasa)
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,9 @@ import (
|
||||
)
|
||||
|
||||
// ExtractIssuePrefix extracts the prefix from an issue ID like "bd-123" -> "bd"
|
||||
// Only considers the first hyphen, so "vc-baseline-test" -> "vc"
|
||||
func ExtractIssuePrefix(issueID string) string {
|
||||
idx := strings.LastIndex(issueID, "-")
|
||||
idx := strings.Index(issueID, "-")
|
||||
if idx <= 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user