Class: ExternalRepoGit

Inherits:
Object
  • Object
show all
Defined in:
lib/gitarro/git_op.rb

Overview

This private class handle the case the repo from PR comes from a user external repo PR open against: openSUSE/gitarro PR repo: MyUSER/gitarro

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pr, options) ⇒ ExternalRepoGit

Returns a new instance of ExternalRepoGit.



132
133
134
135
136
137
# File 'lib/gitarro/git_op.rb', line 132

def initialize(pr, options)
  # pr object for extract all relev. data.
  @pr = pr
  @pr_fix = 'PR-'
  @options = options
end

Instance Attribute Details

#prObject (readonly)

Returns the value of attribute pr.



131
132
133
# File 'lib/gitarro/git_op.rb', line 131

def pr
  @pr
end

#pr_fixObject (readonly)

Returns the value of attribute pr_fix.



131
132
133
# File 'lib/gitarro/git_op.rb', line 131

def pr_fix
  @pr_fix
end

#rem_repoObject (readonly)

Returns the value of attribute rem_repo.



131
132
133
# File 'lib/gitarro/git_op.rb', line 131

def rem_repo
  @rem_repo
end

Instance Method Details

#checkout_intoObject



139
140
141
142
143
144
145
# File 'lib/gitarro/git_op.rb', line 139

def checkout_into
  rem_repo = 'rem' + pr.head.ref
  add_remote(rem_repo)
  fetch_remote(rem_repo)
  checkout_to_rem_branch(rem_repo)
  remove_repo(rem_repo)
end