lib/grb.rb in grb-0.4.0 vs lib/grb.rb in grb-0.4.1

- old
+ new

@@ -56,11 +56,11 @@ :pull => { :desc => "=> pull branch `branch`,default current_branch\ngrb pull [branch] [--explain]", :commands => [ '"#{GIT} fetch #{origin}"', - 'if local_branches.include?(branch) + 'if local_branches.include?(branch) "#{GIT} config branch.#{branch}.remote #{origin}\n" + "#{GIT} config branch.#{branch}.merge refs/heads/#{branch}" else "#{GIT} branch --track #{branch} #{origin}/#{branch}" end', @@ -89,19 +89,26 @@ :remote_rm => { :desc => "=> remove a remote repo\ngrb remote_rm `name` [--explain]", :commands => [ '"#{GIT} remote rm #{branch}"', ] - } + }, + + :prune => { + :desc => "=> prunes the remote branches from the list\ngrb prune", + :commands => [ + '"#{GIT} remote prune #{origin}"', + ] + } } def self.parse(opt) if COMMANDS.keys.include?(opt[:command].to_sym) current_branch,branch,branch_,origin = get_current_branch,opt[:branch],opt[:branch_],ORIGIN COMMANDS[opt[:command].to_sym][:commands].map {|x| exec_cmd(eval(x))} else - help + help end end def self.exec_cmd(str) return true unless str