Skip to content

Commit 083fd3d

Browse files
committed
Merge pull request #4 from koyachi/fix-branch_name_contains_parentheses
escape branch name that contains ( or ). e.g. origin/merge_xctests_migration_with_stage_(broken)
2 parents c559eb4 + 0a03b7c commit 083fd3d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

git-prune-remote-branch

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ opts.parse!
1010
next if branch =~ %r![^/]+/master!
1111
next if branch =~ %r![^/]+/develop!
1212

13+
branch.gsub!(%r!\(!, '\(')
14+
branch.gsub!(%r!\)!, '\)')
1315
if `git branch --contains #{branch}`.each_line.any? { |included| included.strip.chomp =~ /\A[* ]*(develop|master)\z/ }
1416
ref = branch.sub(%r!^([^/]+)/!, '')
1517
command = "git push --delete #{$1} #{ref}"

0 commit comments

Comments
 (0)