Skip to content

Commit 685c87f

Browse files
committed
Remove double dashes and underscores in branch names
1 parent 4240678 commit 685c87f

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/repo.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,17 @@ impl Repository {
119119
"_",
120120
);
121121
while branch_name.contains("..") {
122-
// .... -> .. -> .
122+
// ... -> .. -> .
123123
branch_name = branch_name.replace("..", ".");
124124
}
125+
while branch_name.contains("__") {
126+
// ___ -> __ -> _
127+
branch_name = branch_name.replace("__", "_");
128+
}
129+
while branch_name.contains("--") {
130+
// --- -> -- -> -
131+
branch_name = branch_name.replace("--", "-");
132+
}
125133
while branch_name.contains("${") {
126134
// $${{ -> $( ->
127135
branch_name = branch_name.replace("${", "");

0 commit comments

Comments
 (0)