public DirCacheEntry(byte[] path, int stage) {checkPath(path);if (stage < 0 || 3 < stage)throw new IllegalArgumentException(MessageFormat.format(JGitText.get().invalidStageForPath,stage, toString(path)));info = new byte[INFO_LEN];infoOffset = 0;this.path = path;int flags = ((stage & 0x3) << 12);if (path.length < NAME_MASK)flags |= path.length;elseflags |= NAME_MASK;NB.encodeInt16(info, infoOffset + P_FLAGS, flags);}
public DirCacheEntry(byte[] newPath, int stage){if (!IsValidPath(newPath)){throw new InvalidPathException(ToString(newPath));}if (stage < 0 || 3 < stage){throw new ArgumentException(MessageFormat.Format(JGitText.Get().invalidStageForPath, stage, ToString(newPath)));}info = new byte[INFO_LEN];infoOffset = 0;path = newPath;int flags = ((stage & unchecked((int)(0x3))) << 12);if (path.Length < NAME_MASK){flags |= path.Length;}else{flags |= NAME_MASK;}NB.EncodeInt16(info, infoOffset + P_FLAGS, flags);}