Browse Source

Merge "Set expected old object id to all zeros when head id is null"

stable-1.3
Shawn Pearce 13 years ago committed by Code Review
parent
commit
4e92ae1656
  1. 5
      org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java

5
org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java

@ -228,7 +228,10 @@ public class CommitCommand extends GitCommand<RevCommit> {
ru.setRefLogMessage( ru.setRefLogMessage(
prefix + revCommit.getShortMessage(), false); prefix + revCommit.getShortMessage(), false);
} }
ru.setExpectedOldObjectId(headId); if (headId != null)
ru.setExpectedOldObjectId(headId);
else
ru.setExpectedOldObjectId(ObjectId.zeroId());
Result rc = ru.forceUpdate(); Result rc = ru.forceUpdate();
switch (rc) { switch (rc) {
case NEW: case NEW:

Loading…
Cancel
Save