/// <exception cref="System.IO.IOException"></exception>
        public override bool IsNameConflicting(string name)
        {
            RefList <Ref> packed = GetPackedRefs();
            RefList <RefDirectory.LooseRef> loose = GetLooseRefs();
            // Cannot be nested within an existing reference.
            int lastSlash = name.LastIndexOf('/');

            while (0 < lastSlash)
            {
                string needle = Sharpen.Runtime.Substring(name, 0, lastSlash);
                if (loose.Contains(needle) || packed.Contains(needle))
                {
                    return(true);
                }
                lastSlash = name.LastIndexOf('/', lastSlash - 1);
            }
            // Cannot be the container of an existing reference.
            string prefix = name + '/';
            int    idx;

            idx = -(packed.Find(prefix) + 1);
            if (idx < packed.Size() && packed.Get(idx).GetName().StartsWith(prefix))
            {
                return(true);
            }
            idx = -(loose.Find(prefix) + 1);
            if (idx < loose.Size() && loose.Get(idx).GetName().StartsWith(prefix))
            {
                return(true);
            }
            return(false);
        }