mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-25 07:45:41 +03:00
hunk ownership: use line numbers in eq check
Now that line numbers are set correctly, re-introducing the equality check based on line numbers
This commit is contained in:
parent
104574b9bd
commit
93acbb4421
@ -26,7 +26,7 @@ impl From<&diff::GitHunk> for Hunk {
|
||||
impl PartialEq for Hunk {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
if self.hash.is_some() && other.hash.is_some() {
|
||||
self.hash == other.hash
|
||||
self.hash == other.hash && self.start == other.start && self.end == other.end
|
||||
} else {
|
||||
self.start == other.start && self.end == other.end
|
||||
}
|
||||
@ -233,7 +233,7 @@ mod tests {
|
||||
(
|
||||
"1-2-abc".parse::<Hunk>().unwrap(),
|
||||
"2-3-abc".parse::<Hunk>().unwrap(),
|
||||
true,
|
||||
false,
|
||||
),
|
||||
(
|
||||
"1-2".parse::<Hunk>().unwrap(),
|
||||
|
Loading…
Reference in New Issue
Block a user