Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support renaming local-only branches (#2710)
- Loading branch information
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Feature: rename a local-only branch | ||
|
||
Background: | ||
Given the current branch is a local feature branch "old" | ||
And the commits | ||
| BRANCH | LOCATION | MESSAGE | | ||
| main | local, origin | main commit | | ||
| old | local | old commit | | ||
When I run "git-town rename-branch new" | ||
|
||
Scenario: result | ||
Then it runs the commands | ||
| BRANCH | COMMAND | | ||
| old | git fetch --prune --tags | | ||
| | git branch new old | | ||
| | git checkout new | | ||
| new | git branch -D old | | ||
And the current branch is now "new" | ||
And now these commits exist | ||
| BRANCH | LOCATION | MESSAGE | | ||
| main | local, origin | main commit | | ||
| new | local | old commit | | ||
|
||
Scenario: undo | ||
When I run "git-town undo" | ||
Then it runs the commands | ||
| BRANCH | COMMAND | | ||
| new | git branch old {{ sha 'old commit' }} | | ||
| | git checkout old | | ||
| old | git branch -D new | | ||
And the current branch is now "old" | ||
And the initial branches and hierarchy exist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters