Set expected old object id to all zeros when head id is null
This will be the case on the initial commit to a repository and the ref update should expect a non-existent ref Change-Id: Iaa06e47e6e8cc4a0281c7683b367d4806dd980ea
This commit is contained in:
parent
cd958ba93c
commit
2539b1ee09
|
@ -228,7 +228,10 @@ public RevCommit call() throws NoHeadException, NoMessageException,
|
|||
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:
|
||||
|
|
Loading…
Reference in New Issue