GitSharp.Core.DirectoryCache.DirCacheEntry.getRawMode C# (CSharp) Method

getRawMode() public method

Obtain the raw FileMode bits for this entry.
public getRawMode ( ) : int
return int
        public int getRawMode()
        {
            return NB.DecodeInt32(_info, _infoOffset + PMode);
        }

Usage Example

Example #1
0
        private void ApplyEdits()
        {
            _edits.Sort(EditComparison);

            int maxIdx  = Cache.getEntryCount();
            int lastIdx = 0;

            foreach (PathEdit e in _edits)
            {
                int  eIdx    = Cache.findEntry(e.Path, e.Path.Length);
                bool missing = eIdx < 0;
                if (eIdx < 0)
                {
                    eIdx = -(eIdx + 1);
                }
                int cnt = Math.Min(eIdx, maxIdx) - lastIdx;
                if (cnt > 0)
                {
                    FastKeep(lastIdx, cnt);
                }
                lastIdx = missing ? eIdx : Cache.nextEntry(eIdx);

                if (e is DeletePath)
                {
                    continue;
                }
                if (e is DeleteTree)
                {
                    lastIdx = Cache.nextEntry(e.Path, e.Path.Length, eIdx);
                    continue;
                }

                DirCacheEntry ent;
                if (missing)
                {
                    ent = new DirCacheEntry(e.Path);
                    e.Apply(ent);
                    if (ent.getRawMode() == 0)
                    {
                        throw new ArgumentException("FileMode not set"
                                                    + " for path " + ent.getPathString());
                    }
                }
                else
                {
                    ent = Cache.getEntry(eIdx);
                    e.Apply(ent);
                }
                FastAdd(ent);
            }

            int count = maxIdx - lastIdx;

            if (count > 0)
            {
                FastKeep(lastIdx, count);
            }
        }
All Usage Examples Of GitSharp.Core.DirectoryCache.DirCacheEntry::getRawMode