2014-07-27 23:35:22 +04:00
|
|
|
Feature: hub cherry-pick
|
|
|
|
Background:
|
|
|
|
Given I am in "git://github.com/rtomayko/ronn.git" git repo
|
|
|
|
And I am "mislav" on github.com with OAuth token "OTOKEN"
|
|
|
|
|
|
|
|
Scenario: Unchanged
|
|
|
|
When I run `hub cherry-pick a319d88`
|
|
|
|
Then the git command should be unchanged
|
|
|
|
|
|
|
|
Scenario: From GitHub commit URL
|
|
|
|
When I run `hub cherry-pick https://github.com/rtomayko/ronn/commit/a319d88#comments`
|
|
|
|
Then "git fetch origin" should be run
|
|
|
|
And "git cherry-pick a319d88" should be run
|
|
|
|
|
|
|
|
Scenario: From fork that has existing remote
|
|
|
|
Given the "mislav" remote has url "git@github.com:mislav/ronn.git"
|
|
|
|
When I run `hub cherry-pick https://github.com/mislav/ronn/commit/a319d88`
|
|
|
|
Then "git fetch mislav" should be run
|
|
|
|
And "git cherry-pick a319d88" should be run
|
|
|
|
|
|
|
|
Scenario: Using GitHub owner@SHA notation
|
|
|
|
Given the "mislav" remote has url "git@github.com:mislav/ronn.git"
|
|
|
|
When I run `hub cherry-pick mislav@a319d88`
|
|
|
|
Then "git fetch mislav" should be run
|
|
|
|
And "git cherry-pick a319d88" should be run
|
|
|
|
|
|
|
|
Scenario: Using GitHub owner@SHA notation that is too short
|
|
|
|
When I run `hub cherry-pick mislav@a319`
|
|
|
|
Then the git command should be unchanged
|
|
|
|
|
|
|
|
Scenario: Unsupported GitHub owner/repo@SHA notation
|
|
|
|
When I run `hub cherry-pick mislav/ronn@a319d88`
|
|
|
|
Then the git command should be unchanged
|
|
|
|
|
|
|
|
Scenario: Skips processing if `-m/--mainline` is specified
|
|
|
|
When I run `hub cherry-pick -m 42 mislav@a319d88`
|
|
|
|
Then the git command should be unchanged
|
|
|
|
When I run `hub cherry-pick --mainline 42 mislav@a319d88`
|
|
|
|
Then the git command should be unchanged
|
|
|
|
|
|
|
|
Scenario: Using GitHub owner@SHA notation with remote add
|
|
|
|
When I run `hub cherry-pick mislav@a319d88`
|
2015-05-22 01:00:47 +03:00
|
|
|
Then "git remote add -f --no-tags mislav git://github.com/mislav/ronn.git" should be run
|
2014-07-27 23:35:22 +04:00
|
|
|
And "git cherry-pick a319d88" should be run
|
|
|
|
|
|
|
|
Scenario: From fork that doesn't have a remote
|
|
|
|
When I run `hub cherry-pick https://github.com/jingweno/ronn/commit/a319d88`
|
2015-05-22 01:00:47 +03:00
|
|
|
Then "git remote add -f --no-tags jingweno git://github.com/jingweno/ronn.git" should be run
|
2014-07-27 23:35:22 +04:00
|
|
|
And "git cherry-pick a319d88" should be run
|