Skip to content

Commit 1c39d3a

Browse files
committed
Potential fix: Correctly shrink vec into a box
Shrink the vec into a box correctly, so that it can be serialized and propagated correctly.
1 parent 8bccc41 commit 1c39d3a

File tree

1 file changed

+3
-3
lines changed
  • crates/gitbutler-branch-actions/src

1 file changed

+3
-3
lines changed

crates/gitbutler-branch-actions/src/hunk.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl VirtualBranchHunk {
5353
hunk: GitHunk,
5454
hash: Digest,
5555
mtimes: &mut MTimeCache,
56-
locked_to: &[HunkLock],
56+
locked_to: Box<[HunkLock]>,
5757
) -> Self {
5858
// Get the unique branch ids (lock.branch_id) from hunk.locked_to that a hunk is locked to (if any)
5959
let branch_deps_count = locked_to.iter().map(|lock| lock.branch_id).unique().count();
@@ -70,7 +70,7 @@ impl VirtualBranchHunk {
7070
binary: hunk.binary,
7171
hash,
7272
locked: !locked_to.is_empty(),
73-
locked_to: Some(locked_to.into()),
73+
locked_to: Some(locked_to),
7474
change_type: hunk.change_type,
7575
poisoned: branch_deps_count > 1,
7676
}
@@ -117,7 +117,7 @@ pub(crate) fn file_hunks_from_diffs<'a>(
117117
hunk,
118118
hash,
119119
&mut mtimes,
120-
locked_to,
120+
locked_to.clone().into_boxed_slice(),
121121
)
122122
})
123123
.collect::<Vec<_>>();

0 commit comments

Comments
 (0)