Commit 9fbce64
main.go
@@ -136,7 +136,7 @@ func main() {
}
if yes, a, b := hasConflictingBranchNames(branches); yes {
- echo(fmt.Sprintf("Conflicting branch names: %q and %q", a, b))
+ echo(fmt.Sprintf("Conflicting branchs %q and %q, both want to use %q dir name.", a, b, a.DirName()))
os.Exit(1)
}
utils.go
@@ -117,10 +117,10 @@ func containsBranch(branches []git.Ref, branch string) bool {
func hasConflictingBranchNames(branches []git.Ref) (bool, git.Ref, git.Ref) {
uniq := make(map[string]git.Ref, len(branches))
for _, b := range branches {
- if a, exists := uniq[b.String()]; exists {
+ if a, exists := uniq[b.DirName()]; exists {
return true, a, b
}
- uniq[b.String()] = b
+ uniq[b.DirName()] = b
}
return false, git.Ref{}, git.Ref{}
}