/// <summary>Obtain the ObjectId for the current entry.</summary> /// <remarks> /// Obtain the ObjectId for the current entry. /// <p> /// Every tree supplies an object id, even if the tree does not contain the /// current entry. In the latter case /// <see cref="NGit.ObjectId.ZeroId()">NGit.ObjectId.ZeroId()</see> /// is supplied. /// <p> /// Applications should try to use /// <see cref="IdEqual(int, int)">IdEqual(int, int)</see> /// when possible /// as it avoids conversion overheads. /// </remarks> /// <param name="out">buffer to copy the object id into.</param> /// <param name="nth">tree to obtain the object identifier from.</param> /// <seealso cref="IdEqual(int, int)">IdEqual(int, int)</seealso> public virtual void GetObjectId(MutableObjectId @out, int nth) { AbstractTreeIterator t = trees[nth]; if (t.matches == currentHead) { t.GetEntryObjectId(@out); } else { @out.Clear(); } }
/** * Obtain the ObjectId for the current entry. * <para /> * Every tree supplies an object id, even if the tree does not contain the * current entry. In the latter case {@link ObjectId#zeroId()} is supplied. * <para /> * Applications should try to use {@link #idEqual(int, int)} when possible * as it avoids conversion overheads. * * @param out * buffer to copy the object id into. * @param nth * tree to obtain the object identifier from. * @see #idEqual(int, int) */ public void getObjectId(MutableObjectId @out, int nth) { AbstractTreeIterator t = _trees[nth]; if (t.Matches == _currentHead) { t.getEntryObjectId(@out); } else { @out.Clear(); } }