Class DfsRefUpdate

    • Method Detail

      • getRefDatabase

        protected DfsRefDatabase getRefDatabase()
        Get the reference database this update modifies.
        Specified by:
        getRefDatabase in class RefUpdate
        Returns:
        the reference database this update modifies.
      • getRepository

        protected DfsRepository getRepository()
        Get the repository storing the database's objects.
        Specified by:
        getRepository in class RefUpdate
        Returns:
        the repository storing the database's objects.
      • tryLock

        protected boolean tryLock​(boolean deref)
                           throws java.io.IOException
        Try to acquire the lock on the reference.

        If the locking was successful the implementor must set the current identity value by calling RefUpdate.setOldObjectId(ObjectId).

        Specified by:
        tryLock in class RefUpdate
        Parameters:
        deref - true if the lock should be taken against the leaf level reference; false if it should be taken exactly against the current reference.
        Returns:
        true if the lock was acquired and the reference is likely protected from concurrent modification; false if it failed.
        Throws:
        java.io.IOException - the lock couldn't be taken due to an unexpected storage failure, and not because of a concurrent update.
      • update

        public RefUpdate.Result update​(RevWalk walk)
                                throws java.io.IOException
        Gracefully update the ref to the new value.

        Merge test will be performed according to RefUpdate.isForceUpdate().

        Overrides:
        update in class RefUpdate
        Parameters:
        walk - a RevWalk instance this update command can borrow to perform the merge test. The walk will be reset to perform the test.
        Returns:
        the result status of the update.
        Throws:
        java.io.IOException - an unexpected IO error occurred while writing changes.
      • doLink

        protected RefUpdate.Result doLink​(java.lang.String target)
                                   throws java.io.IOException
        Do link
        Specified by:
        doLink in class RefUpdate
        Parameters:
        target - a String object.
        Returns:
        RefUpdate.Result.NEW on success.
        Throws:
        java.io.IOException