IsId() public static method

Test a string of characters to verify it is a hex format. If true the string can be parsed with FromString(string).
public static IsId ( string id ) : bool
id string the string to test.
return bool
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
            private static bool isValidHead(FileInfo head)
            {
                string r = readFirstLine(head);

                return(head.Exists && r != null && (r.StartsWith("ref: refs/") || ObjectId.IsId(r)));
            }