Skip to main content

rename_current

Function rename_current 

Source
pub fn rename_current(
    branch_name: &str,
    repo: Option<&Repository>,
) -> Result<()>
Expand description

Rename the current local branch.

Mirrors git branch -m <branch_name> semantics: the rename is not forced, so it fails when the target branch already exists.

ยงErrors

  • Repository discovery fails.
  • HEAD is detached or the current branch cannot be resolved.
  • The current local branch cannot be found.
  • The branch rename fails.