Skip to content

Commit

Permalink
feat(record): don't invoke commit message editor again if the commit …
Browse files Browse the repository at this point in the history
…message was provided as a part of the interactive selection
  • Loading branch information
arxanas committed Oct 15, 2023
1 parent 5d51b58 commit 13afef4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions git-branchless-record/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ fn record_interactive(
let result = recorder.run();
let RecordState {
is_read_only: _,
commits: _,
commits,
files: result,
} = match result {
Ok(result) => result,
Expand All @@ -303,6 +303,7 @@ fn record_interactive(
return Ok(Err(ExitCode(1)));
}
};
let message = commits[0].message.clone().unwrap_or_default();

let update_index_script: Vec<UpdateIndexCommand> = result
.into_iter()
Expand Down Expand Up @@ -372,8 +373,8 @@ fn record_interactive(

let args = {
let mut args = vec!["commit"];
if let Some(message) = message {
args.extend(["--message", message]);
if !message.is_empty() {
args.extend(["--message", &message]);
}
args
};
Expand Down

0 comments on commit 13afef4

Please sign in to comment.