diff options
author | Robert Speicher <rspeicher@gmail.com> | 2012-09-26 21:34:51 +0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2012-09-27 00:32:26 +0400 |
commit | 2df3b310f9727956c3ce84322928f3360616f5ad (patch) | |
tree | 57732da5f06bb8bd4c745d59629a93ae6c73a64e /app/roles | |
parent | 5cea3e576dfc2a0d01a44b647bbd1c14a202d9e3 (diff) |
Rename branches and tags Repo methods to branch_names and tag_names
Diffstat (limited to 'app/roles')
-rw-r--r-- | app/roles/repository.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/roles/repository.rb b/app/roles/repository.rb index 191a6d70221..e7e57b0e0c9 100644 --- a/app/roles/repository.rb +++ b/app/roles/repository.rb @@ -46,18 +46,18 @@ module Repository end # Returns an Array of branch names - def branches + def branch_names repo.branches.collect(&:name).sort end # Returns an Array of tag names - def tags + def tag_names repo.tags.collect(&:name).sort.reverse end # Returns an Array of branch and tag names def ref_names - [branches + tags].flatten + [branch_names + tag_names].flatten end def repo @@ -112,12 +112,12 @@ module Repository # - If two or more branches are present, returns the one that has a name # matching root_ref (default_branch or 'master' if default_branch is nil) def discover_default_branch - if branches.length == 0 + if branch_names.length == 0 nil - elsif branches.length == 1 - branches.first + elsif branch_names.length == 1 + branch_names.first else - branches.select { |v| v == root_ref }.first + branch_names.select { |v| v == root_ref }.first end end |