lib/atlassian/stash/git.rb in atlassian-stash-0.3.2 vs lib/atlassian/stash/git.rb in atlassian-stash-0.4.0
- old
+ new
@@ -8,9 +8,19 @@
def get_current_branch
%x(git symbolic-ref HEAD)[/refs\/heads\/(.*)/, 1]
end
+ def get_branches()
+ all = %x{git branch -a}.gsub("*","").gsub(" ", "").split("\n")
+ all.select{|x| not x.include? "->"}
+ end
+
+ def is_branch?(match)
+ all = get_branches
+ not all.select{|x| x == match}.empty?
+ end
+
def is_in_git_repository?
system('git rev-parse')
end
def get_remotes