lib/fulmar/infrastructure/service/git_service.rb in fulmar-1.1.0 vs lib/fulmar/infrastructure/service/git_service.rb in fulmar-1.2.0
- old
+ new
@@ -42,9 +42,17 @@
def preview_branches
branches.select { |name| name.match(/^preview_/) }.sort
end
+ def current_hash
+ @git.head.target_id
+ end
+
+ def current_branch
+ @git.head.name.split('/').last
+ end
+
def checkout(branch_name = derive_branch_name)
if branches.include?(branch_name)
@git.checkout(branches.first)
else
branches = @git.branches.select { |b| b.name.match(/\/#{branch_name}$/) }