Closed
Description
I couldn't find a way to find out whether a file is flagged as assume-unchanged. Am I missing something?
If there isn't an solution this could be a possible implementation:
libgit2sharp/LibGit2Sharp/IndexEntry.cs
...
private const ushort GIT_IDXENTRY_VALID = 0x8000;
/// <summary>
/// Whether the file is marked as assume-unchanged
/// </summary>
public bool AssumeUnchanged { get; private set; }
...
internal static IndexEntry BuildFromPtr( IndexEntrySafeHandle handle )
{
if( handle == null || handle.IsZero )
{
return null;
}
GitIndexEntry entry = handle.MarshalAsGitIndexEntry();
FilePath path = LaxFilePathMarshaler.FromNative( entry.Path );
return new IndexEntry
{
AssumeUnchanged = (GIT_IDXENTRY_VALID & entry.Flags) == GIT_IDXENTRY_VALID,
Path = path.Native,
Id = entry.Id,
StageLevel = Proxy.git_index_entry_stage(handle),
Mode = (Mode)entry.Mode
};
}