1Feature: git town-ship: errors when trying to ship the current feature branch that has no differences with the main branch
2
3  As a developer shipping a branch that has no differences with the main branch
4  I should see an error telling me about this
5  So that I can investigate this issue, and my users always see meaningful progress.
6
7
8  Background:
9    Given my repo has a feature branch named "empty-feature"
10    And the following commits exist in my repo
11      | BRANCH        | LOCATION | MESSAGE        | FILE NAME   | FILE CONTENT   |
12      | main          | remote   | main commit    | common_file | common content |
13      | empty-feature | local    | feature commit | common_file | common content |
14    And I am on the "empty-feature" branch
15    When I run "git-town ship"
16
17
18  Scenario: result
19    Then it runs the commands
20      | BRANCH        | COMMAND                                     |
21      | empty-feature | git fetch --prune --tags                    |
22      |               | git checkout main                           |
23      | main          | git rebase origin/main                      |
24      |               | git checkout empty-feature                  |
25      | empty-feature | git merge --no-edit origin/empty-feature    |
26      |               | git merge --no-edit main                    |
27      |               | git reset --hard {{ sha 'feature commit' }} |
28      |               | git checkout main                           |
29      | main          | git checkout empty-feature                  |
30    And it prints the error:
31      """
32      the branch "empty-feature" has no shippable changes
33      """
34    And I am still on the "empty-feature" branch
35
36
37  Scenario: undo
38    When I run "git-town undo"
39    Then it runs no commands
40    And it prints the error:
41      """
42      nothing to undo
43      """
44    And I am still on the "empty-feature" branch
45    And my repo now has the following commits
46      | BRANCH        | LOCATION      | MESSAGE        | FILE NAME   |
47      | main          | local, remote | main commit    | common_file |
48      | empty-feature | local         | feature commit | common_file |
49