Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aa2ef13 commit 0ab29fcCopy full SHA for 0ab29fc
1 file changed
lib/svn2git/migration.rb
@@ -150,8 +150,12 @@ def clone!
150
end
151
152
def get_branches
153
- @local = run_command("git branch -l").split(/\n/).collect{ |b| b.strip }
154
- @remote = run_command("git branch -r").split(/\n/).collect{ |b| b.strip }
+ # Get the list of local and remote branches, taking care to ignore console color codes and ignoring the
+ # '*' character used to indicate the currently selected branch.
155
+ @local = run_command("git branch -l --no-color").split(/\n/).collect{ |b| b.gsub(/\*/,'').strip }
156
+ @remote = run_command("git branch -r --no-color").split(/\n/).collect{ |b| b.gsub(/\*/,'').strip }
157
+
158
+ # Tags are remote branches that start with "tags/".
159
@tags = @remote.find_all { |b| b.strip =~ %r{^tags\/} }
160
161
0 commit comments