Esempio n. 1
0
        public override bool Equals(object obj)
        {
            if (null == obj)
            {
                return(false);
            }
            if (this == obj)
            {
                return(true);
            }

            GitStash other = obj as GitStash;

            return(other != null && Equals(other));
        }
Esempio n. 2
0
        public static bool TryParse(string s, [NotNullWhen(returnValue: true)] out GitStash?stash)
        {
            // "stash@{i}: WIP on {branch}: {PreviousCommitMiniSHA} {PreviousCommitMessage}"
            // "stash@{i}: On {branch}: {Message}"
            // "stash@{i}: autostash"

            var match = _regex.Match(s);

            if (!match.Success)
            {
                stash = default;
                return(false);
            }

            stash = new GitStash(
                int.Parse(match.Groups["index"].Value),
                match.Groups["message"].Value);

            return(true);
        }
Esempio n. 3
0
 protected bool Equals(GitStash other)
 {
     return(string.Equals(_stash, other._stash));
 }