Skip to content

Commit

Permalink
wip: upgrade version of scm-record
Browse files Browse the repository at this point in the history
To get the fix at arxanas/git-branchless#1013 "fix(record): don't add new files with no selected contents".
  • Loading branch information
arxanas committed Dec 25, 2023
1 parent cc67294 commit 3aec9ea
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 25 deletions.
88 changes: 66 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ ref-cast = "1.0.21"
regex = "1.10.2"
rpassword = "7.3.1"
rustix = { version = "0.38.28", features = ["fs"] }
scm-record = "0.1.0"
scm-record = "0.2.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.108"
slab = "0.4.9"
Expand Down
8 changes: 6 additions & 2 deletions cli/src/merge_tools/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,12 +416,14 @@ pub fn edit_diff_builtin(
.try_collect()
.block_on()?;
let files = make_diff_files(&store, left_tree, right_tree, &changed_files)?;
let mut input = scm_record::helpers::CrosstermInput;
let recorder = scm_record::Recorder::new(
scm_record::RecordState {
is_read_only: false,
files,
commits: Default::default(),
},
scm_record::EventSource::Crossterm,
&mut input,
);
let result = recorder.run().map_err(BuiltinToolError::Record)?;
let tree_id = apply_diff_builtin(store, left_tree, right_tree, changed_files, &result.files)
Expand Down Expand Up @@ -518,6 +520,7 @@ pub fn edit_merge_builtin(
let slices = content.map(|ContentHunk(v)| v.as_slice());
let merge_result = files::merge(&slices);
let sections = make_merge_sections(merge_result)?;
let mut input = scm_record::helpers::CrosstermInput;
let recorder = scm_record::Recorder::new(
scm_record::RecordState {
is_read_only: false,
Expand All @@ -527,8 +530,9 @@ pub fn edit_merge_builtin(
file_mode: None,
sections,
}],
commits: Default::default(),
},
scm_record::EventSource::Crossterm,
&mut input,
);
let state = recorder.run()?;

Expand Down

0 comments on commit 3aec9ea

Please sign in to comment.