Sha256: 5656aafb72deaef30954ca2c91f1b10101e1fc6df6847f924e52c28e2a5e2ed4
Contents?: true
Size: 945 Bytes
Versions: 2
Compression:
Stored size: 945 Bytes
Contents
require 'git-utils/command' class MergeBranch < Command def parser OptionParser.new do |opts| opts.banner = "Usage: git merge-into-branch [branch] [options]" opts.on_tail("-h", "--help", "this usage guide") do puts opts.to_s; exit 0 end end end # Returns a command appropriate for executing at the command line. # For example: # git checkout master # git merge --no-ff --log <branch> def cmd lines = ["git checkout #{target_branch}"] c = ["git merge --no-ff --log"] c << argument_string(unknown_options) unless unknown_options.empty? c << current_branch lines << c.join(' ') lines.join("\n") end private # Returns the name of the branch to be merged into. # If there is anything left in the known options after parsing, # that's the merge branch. Otherwise, it's master. def target_branch self.known_options.first || 'master' end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
git-utils-2.1.0 | lib/git-utils/merge_branch.rb |
git-utils-2.0.0 | lib/git-utils/merge_branch.rb |