summaryrefslogtreecommitdiff
path: root/lib/gitlab/git/branch.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/git/branch.rb')
-rw-r--r--lib/gitlab/git/branch.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/git/branch.rb b/lib/gitlab/git/branch.rb
index c53882787f1..3487e099381 100644
--- a/lib/gitlab/git/branch.rb
+++ b/lib/gitlab/git/branch.rb
@@ -3,6 +3,14 @@
module Gitlab
module Git
class Branch < Ref
+ def self.find(repo, branch_name)
+ if branch_name.is_a?(Gitlab::Git::Branch)
+ branch_name
+ else
+ repo.find_branch(branch_name)
+ end
+ end
+
def initialize(repository, name, target, target_commit)
super(repository, name, target, target_commit)
end