* if this is bare, which implies it has no working directory.
* See {@link #isBare()}.
*/
public ObjectId readOrigHead() throws IOException, NoWorkTreeException {
if (isBare() || getDirectory() == null)
throw new NoWorkTreeException();
byte[] raw = readGitDirectoryFile(Constants.ORIG_HEAD);
return raw != null ? ObjectId.fromString(raw, 0) : null;
}