Class: GitProc::Sync

Inherits:
Process show all
Defined in:
lib/git-process/sync_process.rb

Instance Method Summary collapse

Methods inherited from Process

#config, #fetch_remote_changes, #gitlib, #is_parked?, #logger, #master_branch, #remote, #run, #workdir

Constructor Details

#initialize(base, opts) ⇒ Sync

Returns a new instance of Sync.



23
24
25
26
27
28
29
# File 'lib/git-process/sync_process.rb', line 23

def initialize(base, opts)
  super

  @opts = opts

  self
end

Instance Method Details

#cleanupObject



44
45
46
# File 'lib/git-process/sync_process.rb', line 44

def cleanup
  gitlib.stash_pop if @stash_pushed
end

#runnerObject



49
50
51
# File 'lib/git-process/sync_process.rb', line 49

def runner
  GitProc::Syncer.do_sync(gitlib, @opts)
end

#verify_preconditionsObject

noinspection RubyControlFlowConversionInspection

Raises:



33
34
35
36
37
38
39
40
41
# File 'lib/git-process/sync_process.rb', line 33

def verify_preconditions
  super

  if not gitlib.status.clean?
    change_file_helper.offer_to_help_uncommitted_changes
  end

  raise ParkedChangesError.new(self) if gitlib.is_parked?
end