summaryrefslogtreecommitdiff
path: root/git/repo
Commit message (Collapse)AuthorAgeFilesLines
* Update docsClayton Walker2023-02-021-1/+1
|
* Remove optional from two member variablesClayton Walker2023-01-271-26/+28
|
* Raise exception if return code from check-ignore is not 1Axel Aguado2023-01-211-2/+9
|
* Fix some resource leaks by open file handlesMartin Lambertsen2023-01-092-3/+9
|
* fix/add allow_unsafe_* params in docstrings + fix typoFC Stegerman2023-01-081-2/+4
|
* Fix Sphinx rendering errorsStephan Creutz2022-12-291-0/+3
| | | | | | | | These errors are mostly fixed by either adding blank lines or single spaces for Sphinx documentation key words. The commit solely includes documentation changes, no functional changes.
* Merge pull request #1521 from stsewd/block-insecure-optionsSebastian Thiel2022-12-291-3/+45
|\ | | | | Block insecure options and protocols by default
| * Block unsafe options and protocols by defaultSantos Gallegos2022-12-231-25/+38
| |
| * Forbid unsafe protocol URLs in Repo.clone{,_from}()Steve Kowalik2022-12-231-1/+30
| | | | | | | | | | | | | | | | | | Since the URL is passed directly to git clone, and the remote-ext helper will happily execute shell commands, so by default disallow URLs that contain a "::" unless a new unsafe_protocols kwarg is passed. (CVE-2022-24439) Fixes #1515
* | Fix type hint on create_tagAndrew Cassidy2022-12-291-1/+1
|/ | | | pycharm yells at me without this
* Fix command injectionSantos Gallegos2022-12-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add `--` in some commands that receive user input and if interpreted as options could lead to remote code execution (RCE). There may be more commands that could benefit from `--` so the input is never interpreted as an option, but most of those aren't dangerous. Fixed commands: - push - pull - fetch - clone/clone_from and friends - archive (not sure if this one can be exploited, but it doesn't hurt adding `--` :)) For anyone using GitPython and exposing any of the GitPython methods to users, make sure to always validate the input (like if starts with `--`). And for anyone allowing users to pass arbitrary options, be aware that some options may lead fo RCE, like `--exc`, `--upload-pack`, `--receive-pack`, `--config` (https://github.com/gitpython-developers/GitPython/pull/1516). Ref https://github.com/gitpython-developers/GitPython/issues/1517
* feat(blame): Support custom `rev_opts` for blameJoseph Hale2022-08-301-3/+8
| | | | | | | | | | | | | | | | The `git blame` CLI offers a repeated `-C` option that can be used to detect lines that move within/between files. While a slower operation, it yields more accurate authorship reports. https://git-scm.com/docs/git-blame#Documentation/git-blame.txt--Cltnumgt While GitPython does enable passing custom kwargs to the command line `git` invocation, the fact that kwargs is a dictionary (i.e. no duplicate keys) means that there was no way to request the `-C` option in `git blame` more than once. This commit adds an optional `rev_opts` parameter to the `blame` method which accepts a list of strings to propagate to the CLI invocation of `git blame`. By using a `List[str]` for `rev_opts`, users of GitPython can pass now the `-C` option multiple times to get more detailed authorship reports from `git blame`.
* docs: add typerror exception to active_branch methodPatrick Gerard2022-08-201-0/+2
| | | | | | | | docs: add typerror exception to active_branch method fix: sphinx syntax add author
* BUG: Use Cygwin paths for Cygwin gitDWesl2022-06-111-2/+4
|
* STY: Remove import of now-unused functionDWesl2022-06-111-1/+0
|
* BUG: Convert to native path before checking if absoluteDWesl2022-06-101-1/+5
|
* reformat according to 'black' configuration file.Sebastian Thiel2022-05-182-90/+30
|
* Revert "Remove flake8 linting in favor of `black` formatting"Sebastian Thiel2022-05-181-0/+1
| | | | This reverts commit a7c5d887e943aa51f2270e517954c024a8c01500.
* Remove flake8 linting in favor of `black` formattingSebastian Thiel2022-05-181-1/+0
| | | | `flake8` seems to dislike the formatting of black.
* Run everything through 'black'Sebastian Thiel2022-05-182-257/+456
| | | | | That way people who use it won't be deterred, while it unifies style everywhere.
* Fix various typosluz paz2022-05-072-3/+3
| | | Found via `codespell -q 3 -S ./git/ext/gitdb,./test/fixtures/reflog_master,./test/fixtures/diff_mode_only,./test/fixtures/reflog_HEAD`
* Allow `repo.create_head`'s `commit` arg to be a `SymbolicReference`David Robertson2022-04-021-1/+2
| | | | This matches the signature from `Head.create`.
* fix iter_commits comment, more in line with iter_itemsHoussam Kherraz2022-02-241-2/+2
|
* Fix typing issues with delete_head and Remote.addRuss Allbery2021-09-201-1/+1
| | | | | | | | | | | | | | delete_head and Head.delete historically accept either Head objects or a str name of a head. Adjust the typing to match. This unfortunately requires suppressing type warnings in the signature of RemoteReference.delete, since it inherits from Head but does not accept str (since it needs access to the richer data of RemoteReference). Using assignment to make add an alias for create unfortunately confuses mypy, since it loses track of the fact that it's a classmethod and starts treating it like a staticmethod. Replace with a stub wrapper instead.
* Use the Git class type definition within Repo classmethodsMichael Mulich2021-08-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow the GitCommandWrapperType definition to be used within the Repo classmethods. This change follows the intended purpose as stated in the code, "Subclasses may easily bring in their own custom types by placing a constructor or type here." The usecase that prompted this change has to do with `GIT_SSH_COMMAND`. The goal is to setup a custom `Git` class with knowledge of the value, something like as follows ```python from git import Git as BaseGit, Repo as BaseRepo class Git(BaseGit): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # For example, assign the SSH command using the current flask # app's configured setting. self.update_environment(GIT_SSH_COMMAND=current_app.config['GIT_SSH_COMMAND']) class Repo(BaseRepo): GitCommandWrapperType = _Git ``` With this change, the above example will allow the developer to use `Repo.clone_from(...)` with the indended outcome. Otherwise the developer will have two differing result when using `Repo(...)` vs `Repo.clone_from(...)`.
* Improve type of repo.currently_rebasing_on()Yobmod2021-08-021-2/+2
|
* Improve type of repo.blame_incremental()Yobmod2021-08-021-9/+9
|
* Choose TypedDict!Yobmod2021-08-021-37/+32
|
* Test Dataclass in repo.base.blame() 6Yobmod2021-08-021-6/+5
|
* Test Dataclass in repo.base.blame() 5Yobmod2021-08-021-30/+37
|
* Test Dataclass in repo.base.blame() 4Yobmod2021-08-021-11/+10
|
* Test TypedDict in repo.base.blame() 1Yobmod2021-08-021-13/+14
|
* Test TypedDict in repo.base.blame() 2Yobmod2021-08-021-44/+36
|
* Test Dataclass in repo.base.blame() 3Yobmod2021-08-021-13/+14
|
* Test Dataclass in repo.base.blame() 2Yobmod2021-08-021-2/+2
|
* Test Dataclass in repo.base.blame()Yobmod2021-08-021-37/+66
|
* Test trailing comma in args (>py3.6?)Yobmod2021-08-021-3/+5
|
* Test new union syntax (Pep604)Yobmod2021-08-021-1/+1
|
* Add __future__.annotations to repo/base.pyYobmod2021-08-022-5/+6
|
* Add __future__.annotations to cmd.py2Yobmod2021-08-021-3/+3
|
* Add __future__.annotations to cmd.pyYobmod2021-08-021-7/+7
|
* increase mypy strictness (warn unused ignored and warn unreachable)Yobmod2021-08-022-8/+14
|
* replace more TBDs wiht runtime typesYobmod2021-07-311-4/+5
|
* Add type to repo.base._to_full_tag_pathYobmod2021-07-311-6/+7
|
* Fix more missing types in Symbolic.py, cos GuthubActions pytest stuckYobmod2021-07-281-1/+2
|
* Fix some SymbolicReference typesYobmod2021-07-281-1/+1
|
* Fix SymbolicReference reference typingYobmod2021-07-281-3/+2
|
* Added support of spaces for clone multi_optionsIgor Lakhtenkov2021-07-271-1/+2
|
* Rmv with_metaclass shim, make section constraint generic wrt its ↵Yobmod2021-07-241-2/+4
| | | | configparser type
* Replace all Typeguard with cast, revert update to typing-extensions==3.10.0Yobmod2021-07-241-2/+3
|