Class: ExternalRepoGit
- Inherits:
-
Object
- Object
- ExternalRepoGit
- 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
-
#pr ⇒ Object
readonly
Returns the value of attribute pr.
-
#pr_fix ⇒ Object
readonly
Returns the value of attribute pr_fix.
-
#rem_repo ⇒ Object
readonly
Returns the value of attribute rem_repo.
Instance Method Summary collapse
- #checkout_into ⇒ Object
-
#initialize(pr, options) ⇒ ExternalRepoGit
constructor
A new instance of ExternalRepoGit.
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, ) # pr object for extract all relev. data. @pr = pr @pr_fix = 'PR-' @options = end |
Instance Attribute Details
#pr ⇒ Object (readonly)
Returns the value of attribute pr.
131 132 133 |
# File 'lib/gitarro/git_op.rb', line 131 def pr @pr end |
#pr_fix ⇒ Object (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_repo ⇒ Object (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_into ⇒ Object
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 |