Fix FooterLine.matches(FooterKey) on same length keys
commitdd63f5cfc17d6f52a54e0c6442ea3bed42043b36
authorShawn O. Pearce <spearce@spearce.org>
Tue, 4 May 2010 23:25:20 +0000 (4 16:25 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Tue, 4 May 2010 23:25:20 +0000 (4 16:25 -0700)
tree281669577535255b37a70e6d82264e9da6703e3b
parentd011a377cbf30738a1a2d9b156cf869346adb537
Fix FooterLine.matches(FooterKey) on same length keys

If two keys are the same length, but don't share the same sequence
of characters, we were incorrectly claiming they still matched due
to a bug in the for loop condition.  I used the wrong variable and
the loop never executed, resulting in equality anytime the two keys
being compared were the same length.

Use the proper local variable to loop through the arrays, and add
a JUnit test to verify equality works as expected.

Change-Id: I4a02400e65a9b2e0da925b05a2cc4b579e1dd33a
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FooterLineTest.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/FooterLine.java