mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-20 08:01:46 +03:00
Merge pull request #3263 from gitbutlerapp/hunk-ownership-comparison-fix
fix: revert to using hunk equality with hashes
This commit is contained in:
commit
36c555773c
@ -2053,7 +2053,8 @@ fn get_applied_status(
|
|||||||
// if any of the current hunks intersects with the owned hunk, we want to keep it
|
// if any of the current hunks intersects with the owned hunk, we want to keep it
|
||||||
for (i, git_diff_hunk) in git_diff_hunks.iter().enumerate() {
|
for (i, git_diff_hunk) in git_diff_hunks.iter().enumerate() {
|
||||||
let hash = diff_hash(&git_diff_hunk.diff);
|
let hash = diff_hash(&git_diff_hunk.diff);
|
||||||
if claimed_hunk.shallow_eq(git_diff_hunk) {
|
// Eq compares hashes first, and if one of the hunks lacks a hash, it compares line numbers
|
||||||
|
if claimed_hunk.eq(&Hunk::from(git_diff_hunk)) {
|
||||||
// try to re-use old timestamp
|
// try to re-use old timestamp
|
||||||
let timestamp = claimed_hunk.timestam_ms().unwrap_or(mtime);
|
let timestamp = claimed_hunk.timestam_ms().unwrap_or(mtime);
|
||||||
// push hunk to the end of the list, preserving the order
|
// push hunk to the end of the list, preserving the order
|
||||||
|
Loading…
Reference in New Issue
Block a user