forked from mirrors/jj
cli: make jj describe
not rewrite commit if description was unchanged
This commit is contained in:
parent
203843fc75
commit
c889baaabe
1 changed files with 10 additions and 5 deletions
|
@ -1536,11 +1536,16 @@ fn cmd_describe(
|
||||||
} else {
|
} else {
|
||||||
description = edit_description(repo, commit.description());
|
description = edit_description(repo, commit.description());
|
||||||
}
|
}
|
||||||
let mut tx = repo_command.start_transaction(&format!("describe commit {}", commit.id().hex()));
|
if description == *commit.description() {
|
||||||
CommitBuilder::for_rewrite_from(ui.settings(), repo.store(), &commit)
|
ui.write("Nothing changed.\n")?;
|
||||||
.set_description(description)
|
} else {
|
||||||
.write_to_repo(tx.mut_repo());
|
let mut tx =
|
||||||
repo_command.finish_transaction(ui, tx)?;
|
repo_command.start_transaction(&format!("describe commit {}", commit.id().hex()));
|
||||||
|
CommitBuilder::for_rewrite_from(ui.settings(), repo.store(), &commit)
|
||||||
|
.set_description(description)
|
||||||
|
.write_to_repo(tx.mut_repo());
|
||||||
|
repo_command.finish_transaction(ui, tx)?;
|
||||||
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue