summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/commands/git.go')
-rw-r--r--pkg/commands/git.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index 00ec296de..2bd852de8 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -343,7 +343,7 @@ func (c *GitCommand) CurrentBranchName() (string, error) {
match := re.FindStringSubmatch(output)
branchName = match[1]
}
- return utils.TrimTrailingNewline(branchName), nil
+ return strings.TrimSpace(branchName), nil
}
// DeleteBranch delete branch
@@ -1163,3 +1163,7 @@ func (c *GitCommand) GetPager(width int) string {
func (c *GitCommand) colorArg() string {
return c.Config.GetUserConfig().GetString("git.paging.colorArg")
}
+
+func (c *GitCommand) RenameBranch(oldName string, newName string) error {
+ return c.OSCommand.RunCommand("git branch --move %s %s", oldName, newName)
+}