Skip to content

Commit

Permalink
Remove double dashes and underscores in branch names
Browse files Browse the repository at this point in the history
  • Loading branch information
Baarsgaard committed Mar 3, 2024
1 parent 4240678 commit 685c87f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,17 @@ impl Repository {
"_",
);
while branch_name.contains("..") {
// .... -> .. -> .
// ... -> .. -> .
branch_name = branch_name.replace("..", ".");
}
while branch_name.contains("__") {
// ___ -> __ -> _
branch_name = branch_name.replace("__", "_");
}
while branch_name.contains("--") {
// --- -> -- -> -
branch_name = branch_name.replace("--", "-");
}
while branch_name.contains("${") {
// $${{ -> $( ->
branch_name = branch_name.replace("${", "");
Expand Down

0 comments on commit 685c87f

Please sign in to comment.