Skip to content

Commit

Permalink
Use main for the default branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts committed Feb 21, 2023
1 parent 6cc4414 commit 00e2938
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Jupytext ChangeLog
**Changed**
- Empty tags are not exported to the text notebook anymore ([#960](https://github.com/mwouts/jupytext/issues/960))
- We updated the `yarn.lock` file for the jupyter lab extension to address security vulnerabilities ([#1030](https://github.com/mwouts/jupytext/issues/1030), [#1036](https://github.com/mwouts/jupytext/issues/1036))
- In the pre-commit tests we now use `main` for the main branch


1.14.4 (2022-12-11)
Expand Down
24 changes: 12 additions & 12 deletions tests/test_pre_commit_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def git(*args):
print(out)
return out

git("init")
git("init", "--initial-branch", "main")
git("status")
git("config", "user.name", "jupytext-test-cli")
git("config", "user.email", "jupytext@tests.com")
Expand Down Expand Up @@ -66,7 +66,7 @@ def test_pre_commit_hook(tmpdir):
git("commit", "-m", "created")
git("status")

assert "nb with spaces.py" in git("ls-tree", "-r", "master", "--name-only")
assert "nb with spaces.py" in git("ls-tree", "-r", "main", "--name-only")
assert os.path.isfile(tmp_py)


Expand Down Expand Up @@ -94,8 +94,8 @@ def test_sync_with_pre_commit_hook(tmpdir):
git("commit", "-m", "created")
git("status")

assert "notebook.ipynb" in git("ls-tree", "-r", "master", "--name-only")
assert "notebook.md" not in git("ls-tree", "-r", "master", "--name-only")
assert "notebook.ipynb" in git("ls-tree", "-r", "main", "--name-only")
assert "notebook.md" not in git("ls-tree", "-r", "main", "--name-only")

assert os.path.isfile(tmp_ipynb)
assert not os.path.exists(tmp_md)
Expand All @@ -113,8 +113,8 @@ def test_sync_with_pre_commit_hook(tmpdir):
git("status")

# The pre-commit script should have created and committed the md file
assert "notebook.ipynb" in git("ls-tree", "-r", "master", "--name-only")
assert "notebook.md" in git("ls-tree", "-r", "master", "--name-only")
assert "notebook.ipynb" in git("ls-tree", "-r", "main", "--name-only")
assert "notebook.md" in git("ls-tree", "-r", "main", "--name-only")
assert os.path.isfile(tmp_md)
nb_md = read(tmp_md)
compare_notebooks(nb_md, nb)
Expand All @@ -133,8 +133,8 @@ def test_sync_with_pre_commit_hook(tmpdir):
git("status")

# The pre-commit script should have sync and committed the ipynb file
assert "notebook.ipynb" in git("ls-tree", "-r", "master", "--name-only")
assert "notebook.md" in git("ls-tree", "-r", "master", "--name-only")
assert "notebook.ipynb" in git("ls-tree", "-r", "main", "--name-only")
assert "notebook.md" in git("ls-tree", "-r", "main", "--name-only")

nb = read(tmp_ipynb)
compare_cells(
Expand Down Expand Up @@ -174,7 +174,7 @@ def test_pre_commit_hook_in_subfolder(tmpdir):
git("commit", "-m", "created")
git("status")

assert "nb with spaces.py" in git("ls-tree", "-r", "master", "--name-only")
assert "nb with spaces.py" in git("ls-tree", "-r", "main", "--name-only")
assert os.path.isfile(tmp_py)


Expand Down Expand Up @@ -207,8 +207,8 @@ def test_pre_commit_hook_py_to_ipynb_and_md(tmpdir):
git("commit", "-m", "created")
git("status")

assert "nb with spaces.ipynb" in git("ls-tree", "-r", "master", "--name-only")
assert "nb with spaces.md" in git("ls-tree", "-r", "master", "--name-only")
assert "nb with spaces.ipynb" in git("ls-tree", "-r", "main", "--name-only")
assert "nb with spaces.md" in git("ls-tree", "-r", "main", "--name-only")

assert os.path.isfile(tmp_ipynb)
assert os.path.isfile(tmp_md)
Expand Down Expand Up @@ -283,7 +283,7 @@ def hook():
git("commit", "-m", "created")
git("status")

assert "notebook.py" in git("ls-tree", "-r", "master", "--name-only")
assert "notebook.py" in git("ls-tree", "-r", "main", "--name-only")
assert os.path.isfile(tmp_py)


Expand Down

0 comments on commit 00e2938

Please sign in to comment.