ReadRef() public method

public ReadRef ( string partialName ) : Ref
partialName string
return Ref
Beispiel #1
0
        private ObjectId ResolveSimple(string revstr)
        {
            if (ObjectId.IsId(revstr))
            {
                return(ObjectId.FromString(revstr));
            }
            Ref r = _refDb.ReadRef(revstr);

            return(r != null ? r.ObjectId : null);
        }
Beispiel #2
0
        /// <summary>
        /// Delete the ref.
        /// </summary>
        /// <param name="walk">
        /// A <see cref="RevWalk"/> instance this Delete command can borrow to
        /// perform the merge test. The walk will be reset to perform the test.
        /// </param>
        /// <returns>The result status of the Delete.</returns>
        public RefUpdateResult Delete(RevWalk.RevWalk walk)
        {
            if (Name.StartsWith(Constants.R_HEADS))
            {
                Ref head = _db.ReadRef(Constants.HEAD);
                if (head != null && Name.Equals(head.Name))
                {
                    return(Result = RefUpdateResult.RejectedCurrentBranch);
                }
            }

            try
            {
                return(Result = UpdateImpl(walk, new DeleteStore(this)));
            }
            catch (IOException)
            {
                Result = RefUpdateResult.IOFailure;
                throw;
            }
        }