Skip to content

Commit

Permalink
change error message (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
JunNishimura committed Jun 6, 2023
1 parent 7e0b09d commit d58666f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/store/refs.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (r *Refs) AddBranch(rootGoitPath, newBranchName string, newBranchHash sha.S
// check if branch already exists
n := r.getBranchPos(newBranchName)
if n != NewBranchFlag {
return fmt.Errorf("fatal: a branch named '%s' already exists", newBranchName)
return fmt.Errorf("a branch named '%s' already exists", newBranchName)
}

b := newBranch(newBranchName, newBranchHash)
Expand All @@ -114,7 +114,7 @@ func (r *Refs) RenameBranch(head *Head, rootGoitPath, newBranchName string) erro
// check if new branch name is not used for other branches
n := r.getBranchPos(newBranchName)
if n != NewBranchFlag {
return fmt.Errorf("fatal: branch named '%s' already exists", newBranchName)
return fmt.Errorf("branch named '%s' already exists", newBranchName)
}

// get current branch
Expand Down Expand Up @@ -171,11 +171,11 @@ func (r *Refs) getBranchPos(branchName string) int {
func (r *Refs) DeleteBranch(rootGoitPath, headBranchName, deleteBranchName string) error {
// branch validation
if deleteBranchName == headBranchName {
return fmt.Errorf("error: cannot delete current branch '%s'", headBranchName)
return fmt.Errorf("cannot delete current branch '%s'", headBranchName)
}
n := r.getBranchPos(deleteBranchName)
if n == NewBranchFlag {
return fmt.Errorf("error: branch '%s' not found", deleteBranchName)
return fmt.Errorf("branch '%s' not found", deleteBranchName)
}

// delete from refs
Expand Down

0 comments on commit d58666f

Please sign in to comment.