]> source.dussan.org Git - jgit.git/commit
Fix NameRevCommand when repo has no annotated tags 04/23904/2
authorDave Borowitz <dborowitz@google.com>
Wed, 26 Mar 2014 01:34:54 +0000 (18:34 -0700)
committerDave Borowitz <dborowitz@google.com>
Wed, 26 Mar 2014 01:39:48 +0000 (18:39 -0700)
commit27473d8e66bda58c51eca6f474885bd893e79f07
tree4f29cb5d676ef00ad87599ed8b6f1a4b18d5c3b0
parent5c1736a8d8e408c9fa5ae5a1d39eff02772dc7dc
Fix NameRevCommand when repo has no annotated tags

Previously, calling addAnnotatedTags() did not modify any state when
there were no annotated tags in the repository. This caused the code
to assume no addFoo() methods had been called, and fell back to the
default of adding refs/*. Instead, use null to indicate neither
addRefs() nor addAnnotatedTags() was called.

Add a test for this behavior.

Change-Id: I9926e5ac17e1a983cd399798993031c72bd79c2c
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/NameRevCommandTest.java
org.eclipse.jgit/src/org/eclipse/jgit/api/NameRevCommand.java