ReadRef() 공개 메소드

public ReadRef ( string partialName ) : Ref
partialName string
리턴 Ref
예제 #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);
        }
예제 #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;
            }
        }