def run(self, pack, branch):
        """
        :param pack: Installed Pack Name to get info about
        :type pack: ``str``
        :type branch: ``str``
        """
        packs_base_paths = get_packs_base_paths()

        pack_path = None
        metadata_file = None
        for packs_base_path in packs_base_paths:
            pack_path = os.path.join(packs_base_path, pack)
            pack_yaml_path = os.path.join(pack_path, MANIFEST_FILE_NAME)

            if os.path.isfile(pack_yaml_path):
                metadata_file = pack_yaml_path
                break

        # Pack doesn't exist, finish execution normally with empty metadata
        if not os.path.isdir(pack_path):
            return {"pack": None, "git_status": None}

        if not metadata_file:
            error = 'Pack "%s" doesn\'t contain pack.yaml file.' % (pack)
            raise Exception(error)

        try:
            details = self._parse_yaml_file(metadata_file)
        except Exception as e:
            error = 'Pack "%s" doesn\'t contain a valid pack.yaml file: %s' % (
                pack,
                six.text_type(e),
            )
            raise Exception(error)

        try:
            repo = Repo(pack_path)
            git_status = "Status:\n%s\n\nRemotes:\n%s" % (
                repo.git.status().split("\n")[0],
                "\n".join([remote.url for remote in repo.remotes]),
            )
            ahead_behind = repo.git.rev_list(
                "--left-right", "--count", f"HEAD...origin/{branch}"
            ).split()
            # Dear god.
            if ahead_behind != ["0", "0"]:
                git_status += "\n\n"
                git_status += "%s commits ahead " if ahead_behind[0] != "0" else ""
                git_status += "and " if "0" not in ahead_behind else ""
                git_status += "%s commits behind " if ahead_behind[1] != "0" else ""
                git_status += "origin/master."
        except InvalidGitRepositoryError:
            git_status = None

        return {"pack": details, "git_status": git_status}

        :param pack: Installed Pack Name to get info about
        :type pack: ``str``
        :type branch: ``str``
        
contrib/packs/actions/pack_mgmt/get_installed.py