forked from mislav/hub
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcherry_pick.feature
More file actions
58 lines (48 loc) · 2.59 KB
/
Copy pathcherry_pick.feature
File metadata and controls
58 lines (48 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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 -q --no-tags origin" should be run
And "git cherry-pick a319d88" should be run
Scenario: From GitHub pull request URL
When I run `hub cherry-pick https://github.com/blueyed/ronn/pull/560/commits/a319d88`
And "git fetch -q --no-tags origin refs/pull/560/head" 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 -q --no-tags 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 -q --no-tags 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`
Then "git remote add _hub-cherry-pick git://github.com/mislav/ronn.git" should be run
And "git fetch -q --no-tags _hub-cherry-pick" should be run
And "git remote rm _hub-cherry-pick" should be run
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`
Then "git remote add _hub-cherry-pick git://github.com/jingweno/ronn.git" should be run
And "git fetch -q --no-tags _hub-cherry-pick" should be run
And "git remote rm _hub-cherry-pick" should be run
And "git cherry-pick a319d88" should be run