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)); }
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); }
protected bool Equals(GitStash other) { return(string.Equals(_stash, other._stash)); }