lib/bard/git.rb in bard-0.22.2 vs lib/bard/git.rb in bard-0.23.0

- old
+ new

@@ -5,11 +5,14 @@ ref = `git symbolic-ref HEAD 2>&1`.chomp return false if ref =~ /^fatal:/ ref.sub(/refs\/heads\//, '') # refs/heads/master ... we want "master" end - def fast_forward_merge?(root = "origin/integration", branch = "HEAD") - run_crucial "git fetch origin" + def current_sha + `git rev-parse HEAD`.chomp + end + + def fast_forward_merge?(root, branch) root_head = run_crucial "git rev-parse #{root}" branch_head = run_crucial "git rev-parse #{branch}" @common_ancestor = find_common_ancestor root_head, branch_head @common_ancestor == root_head end