-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
diff: fix unified diff to emit one-lower start line number for empty …
…hunks Both Mercurial and Git (xdiff) have a special case for empty hunks. https://repo.mercurial-scm.org/hg/rev/2b1ec74c961f I also changed the internal line numbers to start from 0 so we wouldn't have to think about whether "N - 1" would underflow. Fixes #5049
- Loading branch information
Showing
9 changed files
with
85 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,7 +104,7 @@ fn test_evolog_with_or_without_diff() { | |
|
||
// Test `--git` format, and that it implies `-p` | ||
let stdout = test_env.jj_cmd_success(&repo_path, &["evolog", "--no-graph", "--git"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
insta::assert_snapshot!(stdout, @r" | ||
rlvkpnrz [email protected] 2001-02-03 08:05:10 66b42ad3 | ||
my description | ||
diff --git a/file1 b/file1 | ||
|
@@ -136,11 +136,11 @@ fn test_evolog_with_or_without_diff() { | |
index 0000000000..257cc5642c | ||
--- /dev/null | ||
+++ b/file2 | ||
@@ -1,0 +1,1 @@ | ||
@@ -0,0 +1,1 @@ | ||
+foo | ||
rlvkpnrz hidden [email protected] 2001-02-03 08:05:08 2b023b5f | ||
(empty) my description | ||
"###); | ||
"); | ||
} | ||
|
||
#[test] | ||
|
Oops, something went wrong.