def resolve(self):
        gm = GitManager()
        gm.load_issue_branch()
        paths = []
        handler = IssueHandler()

        for issue in self.resolved_issues:
            file_path = handler.get_issue_path(issue)
            JsonConvert.ToFile(issue, file_path)
            paths.append(str(file_path))

        repo = gm.obtain_repo()
        for path in paths:
            repo.git.add(path)
Beispiel #2
0
    def from_email(email):
        repo = GitManager.obtain_repo()

        #repo.git.shortlog(se)...
        """ To get all contributors we need to query git's CLI directly and
            analyse the shortlog. The command "git shortlog -se" will give all
            contributors names and email addresses in the format of:
            1\tUser <email>\n - and repeats like this until the end."""
        shortlog = repo.git.shortlog("-se")
        if shortlog != "":
            for line in shortlog.split("\n"):
                str = line.split("\t")[1]
                temp = str.split(" <")
                if (temp[1].replace(">", "") == email):
                    return GitUser(temp[0], email)

        return None
 def resolve(self):
     JsonConvert.ToFile(self.index, Path(self.path))
     gm = GitManager()
     repo = gm.obtain_repo()
     repo.git.add(self.path)
Beispiel #4
0
    def _get_current_user(self, repo=None):
        repo = GitManager.obtain_repo()

        reader = repo.config_reader()
        self.user = reader.get_value("user", "name")
        self.email = reader.get_value("user", "email")