Browse Source

Allow for optional tagger and message in Tag

We should be more lenient when tagging without an
tagger or message. Currently, we will throw an NPE
which is incorrect behavior.

Change-Id: I04e30ce25a9432e4ca56c3f29658ecb24fb18d24
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
stable-0.9
Chris Aniszczyk 14 years ago committed by Shawn O. Pearce
parent
commit
94ba9574cd
  1. 3
      org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java

3
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java

@ -378,11 +378,14 @@ public abstract class ObjectInserter {
w.write(tag.getTag()); w.write(tag.getTag());
w.write("\n"); w.write("\n");
if (tag.getTagger() != null) {
w.write("tagger "); w.write("tagger ");
w.write(tag.getTagger().toExternalString()); w.write(tag.getTagger().toExternalString());
w.write('\n'); w.write('\n');
}
w.write('\n'); w.write('\n');
if (tag.getMessage() != null)
w.write(tag.getMessage()); w.write(tag.getMessage());
w.close(); w.close();
} catch (IOException err) { } catch (IOException err) {

Loading…
Cancel
Save