diff options
author | Ben Rohlfs <brohlfs@google.com> | 2025-02-25 10:01:37 +0100 |
---|---|---|
committer | Ben Rohlfs <brohlfs@google.com> | 2025-02-25 10:10:54 +0100 |
commit | 8720b352a924e321df299e1308eca490e6aa5f68 (patch) | |
tree | b8e5653293816c3300d8329b1ebabdaa7e29bdfa /org.eclipse.jgit/src/org/eclipse/jgit | |
parent | 7c1f4fde04e0c3ca1c5e45f9e9d073feac90e3bf (diff) | |
download | jgit-8720b352a924e321df299e1308eca490e6aa5f68.tar.gz jgit-8720b352a924e321df299e1308eca490e6aa5f68.zip |
Insert the Change-Id at the end of the footer block
This is a follow-up of change 1208616. The goal is to get even closer
to consistency with Gerrit's commit-msg hook.
The modified test cases were all verified against what the commit-msg
hook would do with the same commit message.
The substantial change is that within the footer block we are putting
the Change-Id also after lines matching `includeInFooterPattern`, not
just after lines matching `footerPattern`. That are lines that start
either with a space or with an opening bracket.
Change-Id: I39305154e653f8f5adb6b75ca0f6b349b720e9d8
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/util/ChangeIdUtil.java | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/ChangeIdUtil.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/ChangeIdUtil.java index cd169f9bb7..c8421d6012 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/ChangeIdUtil.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/ChangeIdUtil.java @@ -159,8 +159,7 @@ public class ChangeIdUtil { int footerFirstLine = indexOfFirstFooterLine(lines); int insertAfter = footerFirstLine; for (int i = footerFirstLine; i < lines.length; ++i) { - if (footerPattern.matcher(lines[i]).matches() && - !signedOffByPattern.matcher(lines[i]).matches()) { + if (!signedOffByPattern.matcher(lines[i]).matches()) { insertAfter = i + 1; continue; } |