private bool RenameLog(RefUpdate src, RefUpdate dst)
        {
            FilePath srcLog = refdb.GetLogWriter().LogFor(src.GetName());
            FilePath dstLog = refdb.GetLogWriter().LogFor(dst.GetName());

            if (!srcLog.Exists())
            {
                return(true);
            }
            if (!Rename(srcLog, dstLog))
            {
                return(false);
            }
            try
            {
                int levels = RefDirectory.LevelsIn(src.GetName()) - 2;
                RefDirectory.Delete(srcLog, levels);
                return(true);
            }
            catch (IOException)
            {
                Rename(dstLog, srcLog);
                return(false);
            }
        }
 public _RefWriter_712(RefDirectory _enclosing, LockFile lck, RefDirectory.PackedRefList
                       oldPackedList, RefList <Ref> refs, RefList <Ref> baseArg1) : base(baseArg1)
 {
     this._enclosing    = _enclosing;
     this.lck           = lck;
     this.oldPackedList = oldPackedList;
     this.refs          = refs;
 }
Beispiel #3
0
        /// <exception cref="System.IO.IOException"></exception>
        private void WriteReflog(Repository db, ObjectId newId, string msg, string refName
                                 )
        {
            RefDirectory       refs   = (RefDirectory)db.RefDatabase;
            RefDirectoryUpdate update = ((RefDirectoryUpdate)refs.NewUpdate(refName, true));

            update.SetNewObjectId(newId);
            refs.Log(update, msg, true);
        }
Beispiel #4
0
 public override void SetUp()
 {
     base.SetUp();
     diskRepo = CreateBareRepository();
     refdir   = (RefDirectory)diskRepo.RefDatabase;
     repo     = new TestRepository(diskRepo);
     A        = repo.Commit().Create();
     B        = repo.Commit(repo.GetRevWalk().ParseCommit(A));
     v1_0     = repo.Tag("v1_0", B);
     repo.GetRevWalk().ParseBody(v1_0);
 }
 internal RefDirectoryRename(RefDirectoryUpdate src, RefDirectoryUpdate dst) : base
         (src, dst)
 {
     refdb = ((RefDirectory)src.GetRefDatabase());
 }
 internal RefDirectoryUpdate(RefDirectory r, Ref @ref) : base(@ref)
 {
     database = r;
 }
Beispiel #7
0
 public _RefDirectoryUpdate_190(CyclicBarrier refUpdateLockedRef, CyclicBarrier packRefsDone
                                , RefDirectory baseArg1, Ref baseArg2) : base(baseArg1, baseArg2)
 {
     this.refUpdateLockedRef = refUpdateLockedRef;
     this.packRefsDone       = packRefsDone;
 }
 internal LooseScanner(RefDirectory _enclosing, RefList <RefDirectory.LooseRef> curLoose
                       )
 {
     this._enclosing = _enclosing;
     this.curLoose   = curLoose;
 }