diff options
author | Shawn Pearce <spearce@spearce.org> | 2011-12-08 13:09:02 -0500 |
---|---|---|
committer | Code Review <codereview-daemon@eclipse.org> | 2011-12-08 13:09:02 -0500 |
commit | 4e92ae1656a3cfb6d202706889afe652f2c90bb8 (patch) | |
tree | 49a868f3209f6ec386983f486f83c9e6a673fffe /org.eclipse.jgit | |
parent | 580def2a2383a78250c0fc96243112775fdaf0ea (diff) | |
parent | 2539b1ee096266b7fcca64545f93d7c08ab30f53 (diff) | |
download | jgit-4e92ae1656a3cfb6d202706889afe652f2c90bb8.tar.gz jgit-4e92ae1656a3cfb6d202706889afe652f2c90bb8.zip |
Merge "Set expected old object id to all zeros when head id is null"
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java index fc56f9af11..14a7494ba6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java @@ -228,7 +228,10 @@ public class CommitCommand extends GitCommand<RevCommit> { ru.setRefLogMessage( prefix + revCommit.getShortMessage(), false); } - ru.setExpectedOldObjectId(headId); + if (headId != null) + ru.setExpectedOldObjectId(headId); + else + ru.setExpectedOldObjectId(ObjectId.zeroId()); Result rc = ru.forceUpdate(); switch (rc) { case NEW: |