diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2021-08-03 17:06:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-03 17:06:31 +0100 |
commit | 05c77cf06e82f7932fb9775fad74251ad6c8aa4f (patch) | |
tree | 2491f8abc76300493fc80251fa21a967db48c375 /git/objects/submodule/base.py | |
parent | 335e59dc2cece491a5c5d42396ce70d4ed0715b5 (diff) | |
parent | 0b89bfe855f0faadf359efcfad8ae752d98c6032 (diff) | |
download | gitpython-05c77cf06e82f7932fb9775fad74251ad6c8aa4f.tar.gz |
Merge branch 'main' into patch-1
Diffstat (limited to 'git/objects/submodule/base.py')
-rw-r--r-- | git/objects/submodule/base.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py index 559d2585..d306c91d 100644 --- a/git/objects/submodule/base.py +++ b/git/objects/submodule/base.py @@ -379,6 +379,7 @@ class Submodule(IndexObject, TraversableIterableObj): :return: The newly created submodule instance :note: works atomically, such that no change will be done if the repository update fails for instance""" + if repo.bare: raise InvalidGitRepositoryError("Cannot add submodules to bare repositories") # END handle bare repos @@ -434,7 +435,7 @@ class Submodule(IndexObject, TraversableIterableObj): url = urls[0] else: # clone new repo - kwargs: Dict[str, Union[bool, int, Sequence[TBD]]] = {'n': no_checkout} + kwargs: Dict[str, Union[bool, int, str, Sequence[TBD]]] = {'n': no_checkout} if not branch_is_default: kwargs['b'] = br.name # END setup checkout-branch |