Skip to content

Commit 3ef8781

Browse files
committed
Use correct revspec when stage is false
1 parent ca89695 commit 3ef8781

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

asyncgit/src/sync/diff.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,11 @@ pub fn get_diff(
360360
),
361361
);
362362

363-
let old_revspec = format!("HEAD:{p}");
363+
let old_revspec = if stage {
364+
format!("HEAD:{p}")
365+
} else {
366+
format!(":{p}")
367+
};
364368
let (old_blob_id, old_root) =
365369
resolve_revspec(&gix_repo, &old_revspec);
366370

0 commit comments

Comments
 (0)