1Feature: git town-hack: starting a new feature from a feature branch (without remote repo)
2
3  As a developer working on something unrelated to my current feature branch and without a remote repository
4  I want to be able to create a new up-to-date feature branch and continue my work there
5  So that my work can exist on its own branch, code reviews remain effective, and my team productive.
6
7
8  Background:
9    Given my repo has a feature branch named "existing-feature"
10    And my repo does not have a remote origin
11    And the following commits exist in my repo
12      | BRANCH           | LOCATION | MESSAGE                 |
13      | main             | local    | main commit             |
14      | existing-feature | local    | existing feature commit |
15    And I am on the "existing-feature" branch
16    And my workspace has an uncommitted file
17    When I run "git-town hack new-feature"
18
19
20  Scenario: result
21    Then it runs the commands
22      | BRANCH           | COMMAND                     |
23      | existing-feature | git add -A                  |
24      |                  | git stash                   |
25      |                  | git branch new-feature main |
26      |                  | git checkout new-feature    |
27      | new-feature      | git stash pop               |
28    And I end up on the "new-feature" branch
29    And my workspace still contains my uncommitted file
30    And my repo now has the following commits
31      | BRANCH           | LOCATION | MESSAGE                 |
32      | main             | local    | main commit             |
33      | existing-feature | local    | existing feature commit |
34      | new-feature      | local    | main commit             |
35