Extend IsStash check to include both stash commits