diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2021-03-10 19:26:39 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2021-05-26 00:38:00 +0200 |
commit | 1126f26d21b3aadf364af09c79d27d39de5e9bb9 (patch) | |
tree | 5e733d0115cc4ed604de370b917149ecd8a45e17 /org.eclipse.jgit.test/tst-rsrc | |
parent | 2a0295ccfd1cf8dcb1067575f38c86f430285cda (diff) | |
download | jgit-1126f26d21b3aadf364af09c79d27d39de5e9bb9.tar.gz jgit-1126f26d21b3aadf364af09c79d27d39de5e9bb9.zip |
ApplyCommand: fix "no newline at end" detection
Check the last line of the last hunk of a file, not the last line of
the whole patch.
Note that C git only checks that this line starts with "\ " and is at
least 12 characters long because of possible different texts when non-
English messages are used.
Change-Id: I0db81699eb3e99ed7b536a3e2b8dc97df1f58a89
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit.test/tst-rsrc')
3 files changed, 18 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/hello.patch b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/hello.patch new file mode 100644 index 0000000000..f015a38062 --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/hello.patch @@ -0,0 +1,16 @@ +diff --git a/hello b/hello +index b6fc4c6..0abaeaa 100644 +--- a/hello ++++ b/hello +@@ -1 +1 @@ +-hello +\ No newline at end of file ++bye +\ No newline at end of file +diff --git a/yello b/yello +index 391a8cb..d1ed081 100644 +--- a/yello ++++ b/yello +@@ -1 +1 @@ +-yello ++yellow diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/hello_PostImage b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/hello_PostImage new file mode 100644 index 0000000000..0abaeaa993 --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/hello_PostImage @@ -0,0 +1 @@ +bye
\ No newline at end of file diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/hello_PreImage b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/hello_PreImage new file mode 100644 index 0000000000..b6fc4c620b --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/diff/hello_PreImage @@ -0,0 +1 @@ +hello
\ No newline at end of file |