Skip to content

Commit 112734d

Browse files
authored
Merge pull request #137 from man-group/current-branch-only
(improvement) Pull from current branch on remote
2 parents 62708b1 + 79b12e8 commit 112734d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

notebooker/utils/conversion.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ def ipython_to_pdf(raw_executed_ipynb: str, report_title: str, hide_code: bool =
5656
resources["metadata"] = ResourcesDict()
5757
resources["metadata"]["name"] = report_title
5858
pdf, _ = pdf_exporter.from_notebook_node(
59-
nbformat.reads(raw_executed_ipynb, as_version=nbformat.v4.nbformat),
60-
resources=resources,
59+
nbformat.reads(raw_executed_ipynb, as_version=nbformat.v4.nbformat), resources=resources
6160
)
6261
return pdf
6362

@@ -68,11 +67,11 @@ def _output_ipynb_name(report_name: str) -> str:
6867

6968
def _git_has_changes(repo: git.repo.Repo):
7069
repo.git.fetch()
71-
return repo.commit("origin/master").hexsha != repo.commit("HEAD").hexsha
70+
return repo.commit(f"{repo.remotes[0].name}/{repo.active_branch.name}").hexsha != repo.commit("HEAD").hexsha
7271

7372

7473
def _git_pull_latest(repo: git.repo.Repo):
75-
repo.git.pull("origin", "master")
74+
repo.git.pull()
7675

7776

7877
def _template(report_path: str, py_template_dir: AnyStr) -> AnyStr:

0 commit comments

Comments
 (0)