raw = <<~DIFF
--- test.orig.txt Wed Feb 15 16:10:39 2012
+++ test.new.txt Wed Feb 15 16:11:25 2012
- @@ -1,5 +1,5 @@
+ @@ -1,4 +1,4 @@
Semicolons were mysteriously appearing in code diffs in the repository
-
+ ```
-void DoSomething(std::auto_ptr<MyClass> myObj)
+void DoSomething(const MyClass& myObj)
-
+ ```
DIFF
diff = Redmine::UnifiedDiff.new(raw, :type => 'sbs')
assert_equal 1, diff.size
end
def test_keep_similar_git_footer_line
- raw = <<~'DIFF'
+ raw = <<~DIFF
diff --git a/test1.txt b/test1.txt
--- a/test1.txt
+++ b/test1.txt
$ cd git_utf8_repository_hg
--
-Next line has white space after '-'
- --
+ --\s
---
--
$ touch test.txt
$ hg add test.txt
- $ hg commit -m `echo -e "U+1F603\U1F603"` -u `echo -e "U+1F603\U1F603"`
+ $ hg commit -m `echo -e "U+1F603\\U1F603"` -u `echo -e "U+1F603\\U1F603"`
diff --git a/test2.txt b/test2.txt
--- a/test2.txt
+++ b/test2.txt
@@ -5,9 +5,4 @@
$ hg add test.txt
- $ hg commit -m `echo -e "U+1F603\U1F603"` -u `echo -e "U+1F603\U1F603"`
+ $ hg commit -m `echo -e "U+1F603\\U1F603"` -u `echo -e "U+1F603\\U1F603"`
$ hg bookmark master
--
-Next line has white space after '-'
- --
+ --\s
---
--
$ hg push ../git_utf8_repository
end
def test_git_footer_line
- raw = <<~'DIFF'
+ raw = <<~DIFF
From 1ed13eda266a3e0a5a8624e79ae28874ebcdeb5c Mon Sep 17 00:00:00 2001
From: test <none@none>
Date: Thu, 30 Apr 2020 11:40:20 +0900
--- a/test.txt
+++ b/test.txt
@@ -6,3 +6,5 @@ $ hg add test.txt
- $ hg commit -m `echo -e "U+1F603\U1F603"` -u `echo -e "U+1F603\U1F603"`
+ $ hg commit -m `echo -e "U+1F603\\U1F603"` -u `echo -e "U+1F603\\U1F603"`
$ hg bookmark master
$ hg push ../git_utf8_repository
+$ rpm -q git
+git-1.8.3.1-21.el7_7.x86_64
- --
+ --\s
1.8.3.1
DIFF