Skip to content

Commit

Permalink
Use double-quotes consistently (git-town#1428)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgo authored May 15, 2020
1 parent 62f22fb commit 090e2fd
Show file tree
Hide file tree
Showing 31 changed files with 34 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ Feature: git town-diff-parent: errors if supplied branch does not exist
Then it runs no commands
And it prints the error:
"""
There is no local branch named 'non-existing-feature'
There is no local branch named "non-existing-feature"
"""
And I end up on the "main" branch
2 changes: 1 addition & 1 deletion features/git-town-hack/branch_exists_locally.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Feature: git town-hack: errors when the branch exists locally
| main | git fetch --prune --tags |
And it prints the error:
"""
A branch named 'existing-feature' already exists
A branch named "existing-feature" already exists
"""
And I am still on the "main" branch
And my workspace still contains my uncommitted file
2 changes: 1 addition & 1 deletion features/git-town-hack/branch_exists_remotely.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Feature: git town-hack: errors when the branch exists remotely
| main | git fetch --prune --tags |
And it prints the error:
"""
A branch named 'existing-feature' already exists
A branch named "existing-feature" already exists
"""
And I am still on the "main" branch
And my workspace still contains my uncommitted file
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Feature: git town-kill: errors if supplied branch does not exist
| main | git fetch --prune --tags |
And it prints the error:
"""
There is no branch named 'non-existing-feature'
There is no branch named "non-existing-feature"
"""
And I end up on the "main" branch
And my workspace still contains my uncommitted file
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ Feature: git town-kill: killing a remote branch in offline mode
| BRANCH | COMMAND |
And it prints the error:
"""
Cannot delete remote branch 'feature' in offline mode
Cannot delete remote branch "feature" in offline mode
"""
And I am still on the "main" branch
2 changes: 1 addition & 1 deletion features/git-town-main_branch/update.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ Feature: set the main branch configuration
When I run "git-town main-branch non-existing"
Then it prints the error:
"""
no branch named 'non-existing'
no branch named "non-existing"
"""
2 changes: 1 addition & 1 deletion features/git-town-prepend/on-main-branch.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Feature: git town-prepend: errors when trying to prepend something in front of t
| main | git fetch --prune --tags |
And it prints the error:
"""
The branch 'main' is not a feature branch. Only feature branches can have parent branches.
The branch "main" is not a feature branch. Only feature branches can have parent branches.
"""
And I am still on the "main" branch
And my workspace still contains my uncommitted file
Expand Down
2 changes: 1 addition & 1 deletion features/git-town-prepend/on-perennial-branch.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ Feature: git town-prepend: errors when trying to prepend something in front of t
| production | git fetch --prune --tags |
And it prints the error:
"""
The branch 'production' is not a feature branch. Only feature branches can have parent branches.
The branch "production" is not a feature branch. Only feature branches can have parent branches.
"""
And I am still on the "production" branch
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Feature: git town-rename-branch: errors if the feature branch does not exist
| main | git fetch --prune --tags |
And it prints the error:
"""
There is no branch named 'non-existing-feature'
There is no branch named "non-existing-feature"
"""
And I end up on the "main" branch
And my workspace still contains my uncommitted file
Expand Down
2 changes: 1 addition & 1 deletion features/git-town-rename-branch/current_branch.feature
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Feature: git town-rename-branch: rename current branch implicitly
Then it runs no commands
And it prints the error:
"""
production' is a perennial branch. Renaming a perennial branch typically requires other updates. If you are sure you want to do this, use '--force'.
"production" is a perennial branch. Renaming a perennial branch typically requires other updates. If you are sure you want to do this, use '--force'.
"""


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Feature: git town-rename-branch: errors when the destination branch exists local
| current-feature | git fetch --prune --tags |
And it prints the error:
"""
A branch named 'existing-feature' already exists
A branch named "existing-feature" already exists
"""
And I am still on the "current-feature" branch
And my workspace still contains my uncommitted file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Feature: git town-rename-branch: errors when the destination branch exists remot
| current-feature | git fetch --prune --tags |
And it prints the error:
"""
A branch named 'existing-feature' already exists
A branch named "existing-feature" already exists
"""
And I am still on the "current-feature" branch
And my workspace still contains my uncommitted file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Feature: git town-rename-branch: errors if renaming a feature branch that has un
| current-feature | git fetch --prune --tags |
And it prints the error:
"""
'current-feature' is not in sync with its tracking branch. Please sync the branches before renaming.
"current-feature" is not in sync with its tracking branch. Please sync the branches before renaming.
"""
And I end up on the "current-feature" branch
And my workspace still contains my uncommitted file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Feature: git town-rename-branch: errors if renaming a feature branch that has un
| current-feature | git fetch --prune --tags |
And it prints the error:
"""
'current-feature' is not in sync with its tracking branch. Please sync the branches before renaming.
"current-feature" is not in sync with its tracking branch. Please sync the branches before renaming.
"""
And I end up on the "current-feature" branch
And my workspace still contains my uncommitted file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Feature: git town-rename-branch: renaming a perennial branch with a tracking bra
Then it runs no commands
And it prints the error:
"""
'production' is a perennial branch. Renaming a perennial branch typically requires other updates. If you are sure you want to do this, use '--force'.
"production" is a perennial branch. Renaming a perennial branch typically requires other updates. If you are sure you want to do this, use '--force'.
"""


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Feature: git town-rename-branch: errors if renaming a perennial branch that has
| production | git fetch --prune --tags |
And it prints the error:
"""
'production' is not in sync with its tracking branch. Please sync the branches before renaming.
"production" is not in sync with its tracking branch. Please sync the branches before renaming.
"""
And I end up on the "production" branch
And my workspace still contains my uncommitted file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Feature: git town-rename-branch: errors if renaming a perennial branch that has
| production | git fetch --prune --tags |
And it prints the error:
"""
'production' is not in sync with its tracking branch. Please sync the branches before renaming.
"production" is not in sync with its tracking branch. Please sync the branches before renaming.
"""
And I end up on the "production" branch
And my workspace still contains my uncommitted file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Feature: git town-ship: errors when trying to ship the current feature branch th
| main | git checkout empty-feature |
And it prints the error:
"""
The branch 'empty-feature' has no shippable changes
The branch "empty-feature" has no shippable changes
"""
And I am still on the "empty-feature" branch

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Feature: git town-ship: errors when trying to ship the main branch
Scenario: result
Then it prints the error:
"""
The branch 'main' is not a feature branch. Only feature branches can be shipped.
The branch "main" is not a feature branch. Only feature branches can be shipped.
"""
And I am still on the "main" branch
And my repository now has the following commits
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Feature: git town-ship: errors when trying to ship a perennial branch
| production | git fetch --prune --tags |
And it prints the error:
"""
The branch 'production' is not a feature branch. Only feature branches can be shipped.
The branch "production" is not a feature branch. Only feature branches can be shipped.
"""
And I am still on the "production" branch
And my repository now has the following commits
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Feature: git town-ship: errors when trying to ship a branch that doesn't exist
| main | git fetch --prune --tags |
And it prints the error:
"""
There is no branch named 'non-existing-branch'
There is no branch named "non-existing-branch"
"""
And I end up on the "main" branch
And my workspace still contains my uncommitted file
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Feature: git town-ship: errors when trying to ship the supplied feature branch t
| other-feature | git stash pop |
And it prints the error:
"""
The branch 'empty-feature' has no shippable changes
The branch "empty-feature" has no shippable changes
"""
And I am still on the "other-feature" branch
And my workspace still contains my uncommitted file
2 changes: 1 addition & 1 deletion features/git-town-ship/supplied_branch/main_branch.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Feature: git town-ship: errors when trying to ship the main branch
| feature | git fetch --prune --tags |
And it prints the error:
"""
The branch 'main' is not a feature branch. Only feature branches can be shipped.
The branch "main" is not a feature branch. Only feature branches can be shipped.
"""
And I am still on the "feature" branch
And my workspace still contains my uncommitted file
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Feature: git town-ship: errors when trying to ship a perennial branch
| main | git fetch --prune --tags |
And it prints the error:
"""
The branch 'production' is not a feature branch. Only feature branches can be shipped.
The branch "production" is not a feature branch. Only feature branches can be shipped.
"""
And I am still on the "main" branch
And my workspace still contains my uncommitted file
2 changes: 1 addition & 1 deletion src/cmd/install_fish_autocompletion.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func buildAutocompletionDefinition() string {
}
commandAutocompletion := ""
for _, command := range commands {
commandAutocompletion += fmt.Sprintf("complete --command git --arguments '%s' --description '%s' --condition '__fish_complete_git_town_no_command' --no-files\n", command.name, command.description)
commandAutocompletion += fmt.Sprintf("complete --command git --arguments %q --description %q --condition '__fish_complete_git_town_no_command' --no-files\n", command.name, command.description)
}

return fmt.Sprintf(fishAutocompletionTemplate, commandsSpaceSeparated, commandAutocompletion)
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func getKillStepList(config killConfig) (result steps.StepList) {
case !git.Config().IsOffline():
result.Append(&steps.DeleteRemoteBranchStep{BranchName: config.TargetBranch, IsTracking: false})
default:
fmt.Printf("Cannot delete remote branch '%s' in offline mode", config.TargetBranch)
fmt.Printf("Cannot delete remote branch %q in offline mode", config.TargetBranch)
os.Exit(1)
}
result.Wrap(steps.WrapOptions{
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/rename_branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func getRenameBranchConfig(args []string) (result renameBranchConfig, err error)
}
git.EnsureIsNotMainBranch(result.OldBranchName, "The main branch cannot be renamed.")
if !forceFlag {
git.EnsureIsNotPerennialBranch(result.OldBranchName, fmt.Sprintf("'%s' is a perennial branch. Renaming a perennial branch typically requires other updates. If you are sure you want to do this, use '--force'.", result.OldBranchName))
git.EnsureIsNotPerennialBranch(result.OldBranchName, fmt.Sprintf("%q is a perennial branch. Renaming a perennial branch typically requires other updates. If you are sure you want to do this, use '--force'.", result.OldBranchName))
}
if result.OldBranchName == result.NewBranchName {
util.ExitWithErrorMessage("Cannot rename branch to current name.")
Expand Down
8 changes: 4 additions & 4 deletions src/git/branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ func DoesBranchHaveUnmergedCommits(branchName string) bool {

// EnsureBranchInSync enforces that a branch with the given name is in sync with its tracking branch
func EnsureBranchInSync(branchName, errorMessageSuffix string) {
util.Ensure(IsBranchInSync(branchName), fmt.Sprintf("'%s' is not in sync with its tracking branch. %s", branchName, errorMessageSuffix))
util.Ensure(IsBranchInSync(branchName), fmt.Sprintf("%q is not in sync with its tracking branch. %s", branchName, errorMessageSuffix))
}

// EnsureDoesNotHaveBranch enforces that a branch with the given name does not exist
func EnsureDoesNotHaveBranch(branchName string) {
util.Ensure(!HasBranch(branchName), fmt.Sprintf("A branch named '%s' already exists", branchName))
util.Ensure(!HasBranch(branchName), fmt.Sprintf("A branch named %q already exists", branchName))
}

// EnsureHasBranch enforces that a branch with the given name exists
func EnsureHasBranch(branchName string) {
util.Ensure(HasBranch(branchName), fmt.Sprintf("There is no branch named '%s'", branchName))
util.Ensure(HasBranch(branchName), fmt.Sprintf("There is no branch named %q", branchName))
}

// EnsureHasLocalBranch enforces that a local branch with the given name exists
func EnsureHasLocalBranch(branchName string) {
util.Ensure(HasLocalBranch(branchName), fmt.Sprintf("There is no local branch named '%s'", branchName))
util.Ensure(HasLocalBranch(branchName), fmt.Sprintf("There is no local branch named %q", branchName))
}

// EnsureIsNotMainBranch enforces that a branch with the given name is not the main branch
Expand Down
2 changes: 1 addition & 1 deletion src/git/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (c *Configuration) DeletePerennialBranchConfiguration() {

// EnsureIsFeatureBranch asserts that the given branch is a feature branch.
func (c *Configuration) EnsureIsFeatureBranch(branchName, errorSuffix string) {
util.Ensure(c.IsFeatureBranch(branchName), fmt.Sprintf("The branch '%s' is not a feature branch. %s", branchName, errorSuffix))
util.Ensure(c.IsFeatureBranch(branchName), fmt.Sprintf("The branch %q is not a feature branch. %s", branchName, errorSuffix))
}

// GetAncestorBranches returns the names of all parent branches for the given branch,
Expand Down
2 changes: 1 addition & 1 deletion src/prompt/parent_branches.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The former allows to develop and ship features completely independent of each ot
The latter allows to build on top of currently unshipped features.
`
var parentBranchPromptTemplate = "Please specify the parent branch of '%s':"
var parentBranchPromptTemplate = "Please specify the parent branch of %q:"
var perennialBranchOption = "<none> (perennial branch)"

func filterOutSelfAndDescendants(branchName string, choices []string) []string {
Expand Down
2 changes: 1 addition & 1 deletion src/steps/ensure_has_shippable_changes_step.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type EnsureHasShippableChangesStep struct {
// GetAutomaticAbortErrorMessage returns the error message to display when this step
// cause the command to automatically abort.
func (step *EnsureHasShippableChangesStep) GetAutomaticAbortErrorMessage() string {
return fmt.Sprintf("The branch '%s' has no shippable changes.", step.BranchName)
return fmt.Sprintf("The branch %q has no shippable changes.", step.BranchName)
}

// Run executes this step.
Expand Down

0 comments on commit 090e2fd

Please sign in to comment.