private bool renameLog(RefUpdate src, RefUpdate dst)
        {
            FileInfo srcLog = _refdb.logFor(src.getName());
            FileInfo dstLog = _refdb.logFor(dst.getName());

            if (!srcLog.Exists)
            {
                return(true);
            }

            if (!rename(srcLog.FullName, dstLog.FullName))
            {
                return(false);
            }

            // There be dragons



            try
            {
                int levels = RefDirectory.levelsIn(src.getName()) - 2;
                RefDirectory.delete(srcLog, levels);
                return(true);
            }
            catch (IOException)
            {
                rename(dstLog.FullName, srcLog.FullName);
                return(false);
            }
        }
Beispiel #2
0
 public RefDirectoryUpdate(RefDirectory r, Ref @ref)
     : base(@ref)
 {
     _database = r;
 }
 public RefDirectoryRename(RefDirectoryUpdate src, RefDirectoryUpdate dst)
     : base(src, dst)
 {
     _refdb = (RefDirectory)src.getRefDatabase();
 }
 public LooseScanner(RefList <LooseRef> curLoose, RefDirectory refDirectory)
 {
     this.curLoose = curLoose;
     _refDirectory = refDirectory;
 }