First step with rugged

This commit is contained in:
Dmitriy Zaporozhets 2013-03-28 21:57:38 +02:00
parent 21191318ae
commit 4524ba20b8
3 changed files with 10 additions and 3 deletions

View file

@ -34,6 +34,10 @@ class Repository
@repo ||= Grit::Repo.new(path_to_repo)
end
def rugged
@rugged ||= Rugged::Repository.new(path_to_repo)
end
def commit(commit_id = nil)
Commit.find_or_first(repo, commit_id, root_ref)
end
@ -64,17 +68,17 @@ class Repository
# Returns an Array of branch names
def branch_names
repo.branches.collect(&:name).sort
branches.map(&:name).sort
end
# Returns an Array of Branches
def branches
repo.branches.sort_by(&:name)
rugged.branches.sort_by(&:name)
end
# Returns an Array of tag names
def tag_names
repo.tags.collect(&:name).sort.reverse
rugged.tags.sort.reverse
end
# Returns an Array of Tags