private function parseParents($sha)
    {
        if (!strpos($sha, '^') && !strpos($sha, '~')) {
            return [];
        }
        preg_match_all('#[\^~][0-9]*#', $sha, $matches);
        $parents = [];
        foreach ($matches[0] as $match) {
            $sign = $match[0];
            $number = intval(substr($match, 1) ?: 1);
            if ($sign === '~') {
                for ($i = 1; $i <= $number; $i++) {
                    $parents[] = 1;
                }
            } elseif ($sign === '^') {
                $parents[] = intval($number);
            }
        }

        return $parents;
    }