Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Group submodule functions under Repository.submodules#1250

Merged
jdavid merged 3 commits into
libgit2:masterfrom
jorio:submo
Nov 24, 2023
Merged

Group submodule functions under Repository.submodules#1250
jdavid merged 3 commits into
libgit2:masterfrom
jorio:submo

Conversation

@jorio
Copy link
Copy Markdown
Contributor

@jorio jorio commented Nov 22, 2023

Following up on #1248 (comment), this PR implements a Submodules class that groups submodule functions in a Repository, much like Branches, References and RemoteCollection.

For backward compatibility, I turned the old functions into simple pass-throughs to the new class. Should we write unit tests for the deprecated versions?

@jdavid
Copy link
Copy Markdown
Member

jdavid commented Nov 23, 2023

Great @jorio

Could you please:

  • Remove submodule_status, submodule_cache_all and submodule_cache_clear ; these are new so no need to go through the deprecation process.
  • In add_submodule, init_submodules, lookup_submodule and update_submodules : call warnings.warn(...) ; see pygit2/repository.py line 323
  • Move the Submodules class to its own file submodules.py

Thanks!

@jdavid jdavid merged commit 719dd66 into libgit2:master Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants