def _gitify_repository(self, repo_dir: str) -> Git: """Git-ify source repository tree. :return: Git handler instance to git repository. """ git_handler = Git(repo_dir, repo_dir, silent=True) # Init repo. git_handler.init() # Add all files found in repo. for f in os.listdir(repo_dir): if f != ".git": git_handler.add(f) # Commit files. git_handler.commit(f"committed by snapcraft version: {snapcraft.__version__}") return git_handler
def _gitify_repository(self, repo_dir: str) -> Git: """Git-ify source repository tree. :return: Git handler instance to git repository. """ git_handler = Git(repo_dir, repo_dir, silent=True) # Init repo. git_handler.init() # Add all files found in repo. for f in os.listdir(repo_dir): if f != ".git": git_handler.add(f) # Commit files. timestamp = datetime.now().strftime("%Y-%m-%d %H:%M") git_handler.commit( "snapcraft commit\n\nversion: {}\ntimestamp: {}\n".format( snapcraft.__version__, timestamp)) return git_handler