summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorChris Aniszczyk <caniszczyk@gmail.com>2010-08-18 21:12:15 -0500
committerShawn O. Pearce <spearce@spearce.org>2010-08-18 19:22:42 -0700
commit94ba9574cd5589bbf7a3671533390b43936fe65b (patch)
treed0430185b2f1eb9f7ade4202af85faed527b86ea /org.eclipse.jgit
parent6c9d82b4ce0445905db1d88f419bb8d04a5ed4bc (diff)
downloadjgit-94ba9574cd5589bbf7a3671533390b43936fe65b.tar.gz
jgit-94ba9574cd5589bbf7a3671533390b43936fe65b.zip
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>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java
index 3d700ac49e..a9522452b6 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectInserter.java
@@ -378,12 +378,15 @@ public abstract class ObjectInserter {
w.write(tag.getTag());
w.write("\n");
- w.write("tagger ");
- w.write(tag.getTagger().toExternalString());
- w.write('\n');
+ if (tag.getTagger() != null) {
+ w.write("tagger ");
+ w.write(tag.getTagger().toExternalString());
+ w.write('\n');
+ }
w.write('\n');
- w.write(tag.getMessage());
+ if (tag.getMessage() != null)
+ w.write(tag.getMessage());
w.close();
} catch (IOException err) {
// This should never occur, the only way to get it above is