Skip to content

Commit

Permalink
Have init script clone submodules unconditionally
Browse files Browse the repository at this point in the history
Since 7110bf8 (in #1693), "git submodule update --init --recursive"
was not run on CI, on the mistaken grounds that the CI test
workflows would already have taken care of cloning all submodules
(ever since 4eef3ec when the "submodules: recursive" option was
added to the actions/checkout step).

This changes the init-tests-after-clone.sh script to again run that
command unconditionally, including on CI. The assumption that it
wasn't needed on CI was based on the specific content of
GitPython's own GitHub Actions workflows. But this disregarded that
the test suite is run on CI for *other* projects: specifically, for
downstream projects that package GitPython (#1713).

This also brings back the comment from fc96980 that says more about
how the tests rely on submodules being present (specifically, that
they need a submodule with a submodule). However, that is not
specifically related to the bug being fixed.
  • Loading branch information
EliahKagan committed Oct 18, 2023
1 parent bb48c87 commit 8ea3133
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions init-tests-after-clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@ git reset --hard HEAD~1
# Point the master branch where we started, so we test the correct code.
git reset --hard __testing_point__

# The tests need submodules. (On CI, they would already have been checked out.)
if ! ci; then
git submodule update --init --recursive
fi
# The tests need submodules, including a submodule with a submodule.
git submodule update --init --recursive

# The tests need some version tags. Try to get them even in forks. This fetches
# other objects too. So, locally, we always do it, for a consistent experience.
Expand Down

0 comments on commit 8ea3133

Please sign in to comment.