Sha256: 8f0eb9c053e94d422a8091f3a0d35e56fe5a06ff9342a8f1a5ce96dd1de4718a
Contents?: true
Size: 534 Bytes
Versions: 61
Compression:
Stored size: 534 Bytes
Contents
module Bard::CLI::Git module_function def current_branch 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 current_sha `git rev-parse HEAD`.chomp end def fast_forward_merge?(root, branch) root_head = `git rev-parse #{root}`.chomp branch_head = `git rev-parse #{branch}`.chomp common_ancestor = `git merge-base #{root_head} #{branch_head}`.chomp common_ancestor == root_head end end
Version data entries
61 entries across 61 versions & 1 rubygems