From 79b12e8205e3eea2bb01b4a69ccda0ad102d90a2 Mon Sep 17 00:00:00 2001 From: jbannister Date: Mon, 20 Feb 2023 10:01:29 +0000 Subject: [PATCH] (improvement) Pull from current branch on remote rather than forcing "origin/master". --- notebooker/utils/conversion.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/notebooker/utils/conversion.py b/notebooker/utils/conversion.py index 40b74938..e35212fb 100644 --- a/notebooker/utils/conversion.py +++ b/notebooker/utils/conversion.py @@ -56,8 +56,7 @@ def ipython_to_pdf(raw_executed_ipynb: str, report_title: str, hide_code: bool = resources["metadata"] = ResourcesDict() resources["metadata"]["name"] = report_title pdf, _ = pdf_exporter.from_notebook_node( - nbformat.reads(raw_executed_ipynb, as_version=nbformat.v4.nbformat), - resources=resources, + nbformat.reads(raw_executed_ipynb, as_version=nbformat.v4.nbformat), resources=resources ) return pdf @@ -68,11 +67,11 @@ def _output_ipynb_name(report_name: str) -> str: def _git_has_changes(repo: git.repo.Repo): repo.git.fetch() - return repo.commit("origin/master").hexsha != repo.commit("HEAD").hexsha + return repo.commit(f"{repo.remotes[0].name}/{repo.active_branch.name}").hexsha != repo.commit("HEAD").hexsha def _git_pull_latest(repo: git.repo.Repo): - repo.git.pull("origin", "master") + repo.git.pull() def _template(report_path: str, py_template_dir: AnyStr) -> AnyStr: