lib/git_fonky/command.rb in git_fonky-0.5.0 vs lib/git_fonky/command.rb in git_fonky-0.6.0

- old
+ new

@@ -1,29 +1,25 @@ module GitFonky class Command - attr_reader :repo_dir, :reporter + attr_accessor :branch_name - def initialize(repo_dir:, reporter:) - @repo_dir = repo_dir - @reporter = reporter + def initialize(branch_name = nil) + @branch_name = branch_name end def current_branch `git branch --show-current`.strip end def fetch_upstream - reporter.announce("fetching") - `git fetch upstream #{repo_dir.branch} 2>&1` + `git fetch upstream #{branch_name} 2>&1` end def pull_upstream - reporter.announce("pulling") - `git pull upstream #{repo_dir.branch} 2>&1` + `git pull upstream #{branch_name} 2>&1` end def push_to_origin - reporter.announce("pushing", "to", "origin") - `git push origin #{repo_dir.branch} 2>&1` + `git push origin #{branch_name} 2>&1` end end end