Gets the name of the current branch.
(&self)
| 179 | |
| 180 | /// Gets the name of the current branch. |
| 181 | pub fn current_branch(&self) -> Result<String> { |
| 182 | let output = self |
| 183 | .run_git_command(&["branch", "--show-current"]) |
| 184 | .context("Failed to get current branch")?; |
| 185 | |
| 186 | Ok(output.trim().to_string()) |
| 187 | } |
| 188 | |
| 189 | /// Creates and checks out a new branch. |
| 190 | pub fn checkout_new_branch(&self, branch_name: &str) -> Result<()> { |
no test coverage detected