Skip to content

Commit

Permalink
remote set-url: remove redundant transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
sullyj3 committed Jun 22, 2024
1 parent 769bd11 commit 50db965
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions cli/src/commands/git/remote/set_url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,9 @@ pub fn cmd_remote_set_url(
command: &CommandHelper,
args: &SetUrlArgs,
) -> Result<(), CommandError> {
let mut workspace_command = command.workspace_helper(ui)?;
let workspace_command = command.workspace_helper(ui)?;
let repo = workspace_command.repo();
let git_repo = get_git_repo(repo.store())?;
let mut tx = workspace_command.start_transaction();
git::remote_set_url(&git_repo, &args.remote, &args.url)?;
if tx.mut_repo().has_changes() {
tx.finish(
ui,
format!("set url of git remote {} to {}", &args.remote, &args.url),
)
} else {
Ok(()) // Do not print "Nothing changed."
}
Ok(())
}

0 comments on commit 50db965

Please sign in to comment.