aboutsummaryrefslogtreecommitdiff
path: root/git/test
AgeCommit message (Collapse)Author
2016-04-19Fix accidentally added importVincent Driessen
2016-04-19Add support for getting "aware" datetime infoVincent Driessen
This adds 2 properties to commits. Their values are derived from the existing data stored on them, but this makes them more conveniently queryable: - authored_datetime - committed_datetime These return "aware" datetimes, so they are effectively companions to their raw timestamp equivalents, respectively `authored_date` and `committed_date`. These datetime instances are convenient structures since they show the author-local commit date and their UTC offset.
2016-04-19Support repeated kwargsVincent Driessen
Some Git command line options are allowed to be repeated multiple times. Examples of this are the -C flag which may occur more than once to "strengthen" its effect, or the -L flag on Git blames, to select multiple blocks of lines to blame. $ git diff -C -C HEAD~1 HEAD $ git blame -L 1-3 -L 12-18 HEAD -- somefile.py This patch supports passing a list/tuple as the value part for kwargs, so that the generated Git command contain the repeated options.
2016-04-19Make test stricterVincent Driessen
2016-04-19Make diff patch parsing more reliableVincent Driessen
The a_path and b_path cannot reliably be read from the first diff line as it's ambiguous. From the git-diff manpage: > The a/ and b/ filenames are the same unless rename/copy is involved. > Especially, **even for a creation or a deletion**, /dev/null is not > used in place of the a/ or b/ filenames. This patch changes the a_path and b_path detection to read it from the more reliable locations further down the diff headers. Two use cases are fixed by this: - As the man page snippet above states, for new/deleted files the a or b path will now be properly None. - File names with spaces in it are now properly parsed. Working on this patch, I realized the --- and +++ lines really belong to the diff header, not the diff contents. This means that when parsing the patch format, the --- and +++ will now be swallowed, and not end up anymore as part of the diff contents. The diff contents now always start with an @@ line. This may be a breaking change for some users that rely on this behaviour. However, those users could now access that information more reliably via the normal Diff properties a_path and b_path now.
2016-04-19Merge remote-tracking branch 'upstream/master' into ↵Vincent Driessen
enrich-incremental-blame-output
2016-04-14Return all available data from git-blameVincent Driessen
Returning this now to avoid having to change the function's return value structure later on if we want to emit more information.
2016-04-14Fix test casesVincent Driessen
2016-04-14Support "root" as a special value in .diff() callsVincent Driessen
This enabled getting diff patches for root commits.
2016-04-14Merge pull request #409 from nvie/add-incremental-blame-supportSebastian Thiel
Add incremental blame support
2016-04-13fixed unittest of issue #407 for Python3Piotr Pietraszkiewicz
2016-04-13fix(index): avoid recursing endlessly in add()Piotr Pietraszkiewicz
Issue #407
2016-04-13Add incremental blame supportVincent Driessen
This adds a sibling method to Repo's blame method: Repo.blame_incremental(rev, path, **kwargs) This can alternatively be called using: Repo.blame(rev, path, incremental=True) The main difference is that blame incremental is a bit more efficient and does not return the full file's contents, just the commits and the line number ranges. The parser is a bit more straight-forward and faster since the incremental output format is defined a little stricter.
2016-04-07Fix testsVincent Driessen
2016-03-16Add test and fixture for diff index from raw formatJonathan Chu
This tests the edge case of doing a diff against a single whitespace filename and returns the proper change type. All other normal usage of this diff classmethod should remain unchanged.
2016-03-06config parsers as context mangers can now be reentered for locksRaphael Boidol
2016-02-25Merge pull request #385 from yarikoptic/skip-testSebastian Thiel
ENH: skip test_is_ancestor on git versions < 1.8.0 not supporting git merge-base --is-ancestor
2016-02-20enable config parsers to be used as context managersRaphael Boidol
if used as context managers, the parsers will automatically release their file locks.
2016-02-14ENH: skip test_is_ancestor on git versions < 1.8.0 not supporting git ↵Yaroslav Halchenko
merge-base --is-ancestor
2016-02-11fix(refs): set fixture different versionSebastian Thiel
2016-02-07chore(flake8): unnused importSebastian Thiel
2016-02-07fix(clone): call communicate if there is no progress handlerSebastian Thiel
Previously, it could have happened that pipes ran full, deadlocking the operation Related to #72
2016-01-08DOC: minor typosYaroslav Halchenko
2015-12-14fix(tree): remove Tree.cache - use IndexFile.write_tree() insteadSebastian Thiel
For more information, see CHANGES.rst Fixes #369
2015-12-14fix(tree): show that fixing Tree.cache is not possibleSebastian Thiel
The problem is that a per-tree modification API cannot work properly, as the sorting is based on full paths of all entries within the repository. This feat can only be achieved by the index, which to my knowledge already does it correctly. The only fix is to remove the misleading API entirely, which will happen in the next commit. Related to #369
2015-12-13fix(tree): tree item sort now uses git-styleSebastian Thiel
Previously it was possible to generate trees which didn't appear legit to git as gitpython's sorting was a simple alpha-numeric sort. Git uses one that minimizes literal string comparisons though, and thus behaves slightly differently sometimes. Fixes #369
2015-09-06fix(config): ignore empty values in config fileSebastian Thiel
Similar to git, we now ignore options which have no value. Previously it would not handle it consistently, and throw a parsing error the first time the cache was built. Afterwards, it was fully usable though. Now we specifically check for the case of no-value options instead. Closes #349
2015-08-29fix(compat): make test work with git >= 2.5Sebastian Thiel
2015-08-29fix(repo): fail loudly if worktrees are usedSebastian Thiel
As GitPython is in maintenance mode, there will be no new features. However, I believe it's good idea to explicitly state we do not support certain things if this is the case. Therefore, when worktrees are encountered, we will throw an specific exception to indicate that. The current implementation is hacky to speed up development, and increases the risk of failing due to false-positive worktree directories. Related to #344
2015-08-22fix(repo): use GitCmdObjectDB by defaultSebastian Thiel
This should fix resource leaking issues once and for all. Related #304
2015-08-21Merge pull request #341 from StyXman/masterSebastian Thiel
fix(cmd): make short options with arguments become two separate argum…
2015-08-20fix(test): update to changes.Marcos Dione
2015-08-17fix(test_index): fix encodingSebastian Thiel
I really never want to touch python again, and never deal with py2/3 unicode handling anymore. By now, it seems pretty much anything is better. Is python to be blamed for it entirely ? Probably not, but there are better alternatives. Nim ? Rust ? Ruby ? Totally
2015-08-17fix(commit): serialization timezone handlingSebastian Thiel
Previously timezones which were not divisable by 3600s would be parsed correctly, but would serialize into a full hour, rounded up. Now floating point computation is used which fixes the issue. Related to #336
2015-08-08fix(tests): remove dependency on sort orderSebastian Thiel
Now we select the submodule by name, not by index. The latter is not deterministic. Closes #335
2015-08-08tests(submodule): add new submodule commitsSebastian Thiel
It's somewhat more complex to add new commits in submodules to the parent repository. The new test shows how to do that in a 'GitPythonic' way. Related to #335
2015-07-29fix(index):allow adding non-unicode paths to indexSebastian Thiel
This issue only surfaced in python 2, in case paths containing unicode characters were not actual unicode objects. In python 3, this was never the issue. Closes #331
2015-07-29fix(diff): mode-assertions now deal with 0Sebastian Thiel
If the file was not present, the mode seen in a diff can be legally '0', which previously caused an assertion to fail for no good reason. Now the assertion tests for None instead. Closes #323
2015-07-21Implement is_ancestorSandy Carter
Wrap `git merge-base --is-ancestor` into its own function because it acts as a boolean check unlike base `git merge-base call`
2015-07-20fix(encoding): in untracked_files() and indexSebastian Thiel
* untracked_files could, if there were spaces in the path returned, re-rencode the previously decoded unicode string thanks to a `decode("string_escape")` call. Now re-encode into utf-8 afterwards - added test to assure this works indeed * IndexFile.add() didn't handle unicode correctly and would write broken index files. The solution was to compute the path length after encoding it into utf-8 bytes, not before ... . Closes #320
2015-07-17added tests for commits with datesavi
2015-07-16Correct doc errorsMarian Wieczorek
revA..revB &rarr; revA...revB (three instead of two dots) [base.py, line 467](https://github.com/gitpython-developers/GitPython/blob/master/git/repo/base.py#L467) rorepo is a ~~a~~ Repo instance [test_docs.py, line 21](https://github.com/gitpython-developers/GitPython/blob/master/git/test/test_docs.py#L21) closes #314
2015-07-03fix(travis): get py2.6 to workSebastian Thiel
Seems like OSX is somewhat special here ... .
2015-07-03fix(cmd): work with py3Sebastian Thiel
Fixed additional test which seems to have different outcomes depending on the interpreter. This just makes it work withouth attempting to find the root cause of the issue.
2015-07-03fix(cmd): don't open stdout when fetchingSebastian Thiel
This allows us to use the main thread to parse stderr to get progress, and resolve assertion failures hopefully once and for all. Relates to #301
2015-07-03test(git): remove unnecessary fixtureSebastian Thiel
Test was adjusted as well to parse only a single file which simulates stderr output.
2015-07-03fix(cmd): line parsingSebastian Thiel
* Previously we could fail to parse the last line within a read buffer, which is now fixed. * Added a test to verify our *slow* line parsing works as expected.
2015-06-26fix(git-test): assure test does works on linuxSebastian Thiel
It shows that the previous implementation was never really working on linux, and thus failed on travis as well for good reason. Closes #303
2015-06-26fix(index): handle adding symlinks to dirsSebastian Thiel
When expanding directories, check if it is a symlink and don't expand them at all. Previously, we followed symlinks and expanded their contents, which could lead to weird index files. Fixes #302
2015-06-10fix(remote): assert fetch respec is setSebastian Thiel
It turns out we can't deal do fetches if no refspec is set as git will change the format of the fetch return values, providing less information than usual. A test was added to show that such a case will fail, and an assertion will assure we don't attempt to fetch/pull if there is no refspec for 'fetch'. Closes #296