summaryrefslogtreecommitdiff
path: root/test/test_commit.py
Commit message (Collapse)AuthorAgeFilesLines
* Update Commit.trailer_list to return tuples.Twist2023-04-221-4/+4
|
* Deprecate Commit.trailers.Twist2023-04-221-6/+0
|
* Add trailers_list and trailers_list methods to fix the commit trailers ↵Twist2023-04-211-36/+47
| | | | functionality. Update trailers tests.
* fix files list on file renameMatteo Croce2023-01-131-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Use the same regex as the Actor class when determining co-authors.Twist2022-08-241-1/+1
|
* Add malformed co-authors to the test, to check they aren't detected with the ↵Twist2022-08-231-2/+6
| | | | regex.
* Add co_authors property to the Commit object, which parses the commit ↵Twist2022-08-221-0/+11
| | | | message for designated co-authors, include a simple test.
* reformat according to 'black' configuration file.Sebastian Thiel2022-05-181-54/+20
|
* Run everything through 'black'Sebastian Thiel2022-05-181-92/+160
| | | | | That way people who use it won't be deterred, while it unifies style everywhere.
* Use git interpret-trailers for trailers propertyKet3r2022-01-071-2/+2
| | | | | | | The whitespace handling and trailer selection isn't very trivial or good documented. It therefore seemed easier and less error prone to just call git to parse the message for the trailers section and remove superfluos whitespaces.
* Add failing unit testPeter Kempter2022-01-071-0/+46
|
* Rmv old py2.7 __future__ importsYobmod2021-07-191-2/+0
|
* rmv python 3.5 checks from testsYobmod2021-07-191-1/+1
|
* Type Traversable.traverse() better, start types of submoduleYobmod2021-06-301-0/+13
|
* add replace method to git.CommitLars Kellogg-Stedman2021-02-151-0/+20
| | | | | | | | | | | This adds a replace method to git.Commit. The replace method returns a copy of the Commit object with attributes replaced from keyword arguments. For example: >>> old = repo.head.commit >>> new = old.replace(message='This is a test') closes #1123
* Fix inheritance issue at commit.iter_itemsYuri Volchkov2021-02-051-0/+7
| | | | | | | The iterator used to yield Commit() objects, which does not play well with inheritance. Yield cls() instead. Signed-off-by: Yuri Volchkov <yuri@volch.org>
* tests: move to root dirKonrad Weihmann2020-07-121-0/+393
| | | | | | | | | This should ensure that tests are NOT packaged into release package by setuptools, as tests are development only + fixtures after moving Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
* Revert moving tests out of 'git' folder, related to #1030Sebastian Thiel2020-07-121-393/+0
|
* tests: move to root dirKonrad Weihmann2020-07-121-0/+393
| | | | | | | | | This should ensure that tests are NOT packaged into release package by setuptools, as tests are development only + fixtures after moving Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
* Moved everything into the git subdirectory - some tests still need to be ↵Sebastian Thiel2010-11-251-275/+0
| | | | adjusted
* Initial interface including some of the implementation of the RefLog. ↵Sebastian Thiel2010-11-231-0/+2
| | | | | | TestCase scetched out for now tests: Added tests to verify that objects don't have a dict. Previously, due to a missing __slots__ member in Serializable, most objects would indeed have a dict, although the opposite was intended
* Updated MANIFEST and setup to include fixtures. Adjusted includes in all ↵Sebastian Thiel2010-11-211-1/+1
| | | | tests to work with the new directory structure
* flattened test folder structure, didn't adjust any file content yetSebastian Thiel2010-11-211-0/+273