summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add check to test bare repoClayton Walker2023-02-011-0/+1
|
* Remove optional from two member variablesClayton Walker2023-01-271-26/+28
|
* Merge pull request #1547 from jcowgill/non-hour-timezonesSebastian Thiel2023-01-252-16/+40
|\ | | | | Fix timezone parsing functions for non-hour timezones
| * Fix timezone parsing functions for non-hour timezonesJames Cowgill2023-01-242-16/+40
|/ | | | | | | | The `utctz_to_altz` and `altz_to_utctz_str` functions fail to handle timezones with UTC offsets that are not a multiple of one hour. Rewrite them and add some unit tests. Fixes #630
* Merge pull request #1545 from Lightborne/fix_ignoredSebastian Thiel2023-01-222-2/+36
|\ | | | | Fix ignored
| * Raise exception if return code from check-ignore is not 1Axel Aguado2023-01-211-2/+9
| |
| * Add test to verify GitCommandError is raised when check-ignore is run ↵Axel Aguado2023-01-211-1/+12
| | | | | | | | against a file behind a symlink
| * Add test_ignored_items_reportedAxel Aguado2023-01-211-0/+16
|/
* Merge pull request #1541 from hugovk/add-3.11Sebastian Thiel2023-01-177-30/+44
|\ | | | | Declare support for Python 3.11
| * Lint with Flake8 via pre-commitHugo van Kemenade2023-01-166-27/+40
| |
| * Upgrade Python syntax with pyupgrade --py37-plusHugo van Kemenade2023-01-151-1/+1
| |
| * Fix typoHugo van Kemenade2023-01-151-2/+2
| |
| * Declare support for Python 3.11Hugo van Kemenade2023-01-151-0/+1
|/
* Merge pull request #1537 from teknoraver/mainSebastian Thiel2023-01-142-2/+33
|\ | | | | fix files list on file rename
| * fix files list on file renameMatteo Croce2023-01-132-2/+33
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GitPython parses the output of `git diff --numstat` to get the files changed in a commit. This breaks when a commit contains a file rename, because the output of `git diff` is different than expected. This is the output of a normal commit: $ git diff --numstat 8f41a390bf9a^ 8f41a390bf9a 30 5 test/test_repo.py And this a commit containing a rename: $ git diff --numstat 185d847ec764^ 185d847ec764 3 1 .github/workflows/{test_pytest.yml => Future.yml} This can be triggered by this code: for commit in repo.iter_commits(): print(commit.hexsha) for file in commit.stats.files: print(file) Which will print for the normal commit: 8f41a390bf9a54db6f85032bc56b453307b95451 'test/test_repo.py' And when there is a rename: 185d847ec7647fd2642a82d9205fb3d07ea71715 '.github/workflows/{test_pytest.yml => Future.yml}' Additionally, when a path member is removed, the file list become a list of strings, breaking even more the caller. This is in the Linux kernel tree: $ git diff --numstat db401875f438^ db401875f438 1 1 tools/testing/selftests/drivers/net/mlxsw/{spectrum-2 => }/devlink_trap_tunnel_ipip6.sh and GitPython parses it as: db401875f438168c5804b295b93a28c7730bb57a ('tools/testing/selftests/drivers/net/mlxsw/{spectrum-2 => ' '}/devlink_trap_tunnel_ipip6.sh') Fix this by pasing the --no-renames option to `git diff` which ignores renames and print the same output as if the file was deleted from the old path and created in the new one: $ git diff --numstat --no-renames 185d847ec764^ 185d847ec764 57 0 .github/workflows/Future.yml 0 55 .github/workflows/test_pytest.yml
* Merge pull request #1532 from marlamb/feature/reduce-resource-leaksSebastian Thiel2023-01-092-3/+9
|\ | | | | Fix some resource leaks by open file handles
| * Fix some resource leaks by open file handlesMartin Lambertsen2023-01-092-3/+9
|/
* Merge pull request #1531 from obfusk/fix-tempfileSebastian Thiel2023-01-083-454/+517
|\ | | | | use tempfile.TemporaryDirectory & fix clone_from_unsafe_protocol tests
| * fix clone_from_unsafe_protocol testsFC Stegerman2023-01-081-5/+30
| |
| * replace tempfile.mkdtemp w/ tempfile.TemporaryDirectoryFC Stegerman2023-01-083-450/+488
| |
* | Merge pull request #1530 from obfusk/fix-unsafe-param-docstringSebastian Thiel2023-01-083-3/+20
|\ \ | |/ |/| fix/add allow_unsafe_* params in docstrings + fix typo
| * fix/add allow_unsafe_* params in docstrings + fix typoFC Stegerman2023-01-083-3/+20
|/
* tests: Use `command -v` instead of third-party `which` programMichał Górny2022-12-311-1/+1
| | | | | | | | Use `command -v` to locate the git executable instead of `which`. The former is guaranteed to always be available according to POSIX, while which(1) is a redundant third-party tool that is slowly being phased out from Linux distributions. In particular, Gentoo no longer installs it by default.
* Fix Sphinx rendering errorsStephan Creutz2022-12-2912-17/+37
| | | | | | | | 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.
* adjust changelog prior to release3.1.30Sebastian Thiel2022-12-292-1/+6
|
* Merge pull request #1521 from stsewd/block-insecure-optionsSebastian Thiel2022-12-2910-21/+752
|\ | | | | Block insecure options and protocols by default
| * Updates from reviewSantos Gallegos2022-12-284-17/+110
| |
| * Submodule testsSantos Gallegos2022-12-271-1/+115
| |
| * More testsSantos Gallegos2022-12-274-7/+247
| |
| * Update/add tests for Repo.clone*Santos Gallegos2022-12-271-27/+121
| |
| * Updates from reviewSantos Gallegos2022-12-273-19/+16
| |
| * Block unsafe options and protocols by defaultSantos Gallegos2022-12-235-36/+160
| |
| * Forbid unsafe protocol URLs in Repo.clone{,_from}()Steve Kowalik2022-12-233-1/+70
| | | | | | | | | | | | | | | | | | 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
* | Document PushInfoListtimski2022-12-291-6/+10
|/
* Merge branch 'fix-cmd-injection'Sebastian Thiel2022-12-225-4/+44
|\
| * update changelogSebastian Thiel2022-12-221-0/+12
| |
| * Add testSantos Gallegos2022-12-211-0/+26
| |
| * Fix CISantos Gallegos2022-12-201-1/+1
| | | | | | | | Taken from https://github.com/gitpython-developers/GitPython/pull/1516/
| * Fix command injectionSantos Gallegos2022-12-202-3/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Bump cygwin/cygwin-install-action from 2 to 3dependabot[bot]2022-11-281-1/+1
| | | | | | | | | | | | | | Bumps [cygwin/cygwin-install-action](https://github.com/cygwin/cygwin-install-action) from 2 to 3. - [Release notes](https://github.com/cygwin/cygwin-install-action/releases) - [Commits](https://github.com/cygwin/cygwin-install-action/compare/v2...v3) --- updated-dependencies: - dependency-name: cygwin/cygwin-install-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
* fix CI by allowing the file protocol as well.Sebastian Thiel2022-11-283-1/+8
|
* Merge pull request #1501 from SergeantMenacingGarlic/date_typesSebastian Thiel2022-10-142-4/+5
|\ | | | | Add datetime.datetime type to commit_date and author_date
| * Add datetime.datetime type to commit_date and author_dateSergeantMenacingGarlic2022-10-132-4/+5
|/
* prepare next release3.1.29Sebastian Thiel2022-10-112-1/+9
|
* fix version replacement in `setup.py` (#1500)Sebastian Thiel2022-10-111-1/+1
| | | | | | | | It would fail to perform the replacement, but unfortunately wouldn't stop the release process. The latter could be done, but isn't implemented either as it's hard to test given everything is runtime.
* remove package signingSebastian Thiel2022-10-071-1/+1
| | | | | The new key isn't signed with the old key so not accepted downstream, and that's it as the old key literally broke and there is no backup.
* bump version to 3.1.283.1.28Sebastian Thiel2022-10-071-1/+1
|
* prepare changelogSebastian Thiel2022-10-071-0/+6
|
* Merge pull request #1497 from dwapstra/git_diff_emptySebastian Thiel2022-09-272-0/+9
|\ | | | | Ignore empty info in diff line