diff options
author | Ivan Frade <ifrade@google.com> | 2023-11-29 10:51:04 -0800 |
---|---|---|
committer | Ivan Frade <ifrade@google.com> | 2023-11-29 14:18:12 -0800 |
commit | 5552242588b8dd4dab155324cc8b12a3c61dd1e5 (patch) | |
tree | 82af861637d54595cf0c9566116abcd7e8b97965 /org.eclipse.jgit | |
parent | acf97be2d650ee9c24084498360617a6246a1235 (diff) | |
download | jgit-5552242588b8dd4dab155324cc8b12a3c61dd1e5.tar.gz jgit-5552242588b8dd4dab155324cc8b12a3c61dd1e5.zip |
FooterLine: First line cannot be a footer
The first line of the commit message cannot be a footer line. This
restriction was dropped in commit [1] while adding multiline
footers. This affects at least the git-numberer gerrit plugin, that
even have a test for it [2].
Reintroduce the restriction that the first line of the commit message
cannot be a footer and bring the test from git-numberer to jgit.
[1] https://review.gerrithub.io/c/eclipse-jgit/jgit/+/1172664
[2] https://chromium.googlesource.com/infra/gerrit-plugins/git-numberer/+/refs/heads/main/src/test/java/com/googlesource/chromium/plugins/gitnumberer/GetFooterLinesTest.java
Change-Id: Id3fa6b8614664dbc3fdccffe1006b0b9752a8de6
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FooterLine.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FooterLine.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FooterLine.java index cadeaec6e0..309d46f690 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FooterLine.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FooterLine.java @@ -107,6 +107,10 @@ public final class FooterLine { break; } } + if (keyStart == msgB) { + // Fist line cannot be a footer + continue; + } r.add(new FooterLine(raw, enc, keyStart, keyEnd, valStart, valEnd)); } |