summaryrefslogtreecommitdiff
path: root/tests-clar
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | Split UTF-16 and UTF-8 buffer sizes for win32Ben Straub2013-08-051-11/+11
| | | | | | | | | | | | | | | | | | | | Also fixed up call-sites to use the correct buffer sizes, especially when converting to utf-8.
* | | | Update to clar 7bf638b80Ben Straub2013-08-122-2/+2
| | | |
* | | | odb: free object data when id is ambiguousCarlos Martín Nieto2013-08-121-0/+1
| | | | | | | | | | | | | | | | | | | | By the time we recognise this as an ambiguous id, the object's data has been loaded into memory. Free it when returning EABMIGUOUS.
* | | | Improve building ignore file listsRussell Belfer2013-08-091-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The routines to push and pop ignore files while traversing a directory had some issues. In particular, setting up the initial list would sometimes push an ignore file before it ought to be applied if the starting path was a directory containing an ignore file. Also, the pop function was not always matching the right part of the path and would fail to pop ignores from the list in some cases. This adds some tests that exercise a particular problematic case and then fixes the problems that I could find related to this. At some point, I'd like to isolate this ignore rule management code and rewrite it, but that's a larger project and right now, I'll opt to just try to fix the broken behaviors.
* | | | Revert PR #1462 and provide alternative fixRussell Belfer2013-08-091-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This rolls back the changes to fnmatch parsing from commit 2e40a60e847d6c128af23e24ea7a8efebd2427da except for the tests that were added. Instead this adds couple of new flags that can be passed in when attempting to parse an fnmatch pattern. Also, this changes the pathspec match logic to special case matching a filename with a '!' prefix against a negative pattern. This fixes the build.
* | | | Merge pull request #1764 from ethomson/status_renames_from_rewritesRussell Belfer2013-08-091-0/+129
|\ \ \ \ | | | | | | | | | | Add rename from rewrites to status
| * | | | Add rename from rewrites to statusEdward Thomson2013-08-051-0/+129
| |/ / / | | | | | | | | | | | | | | | | | | | | In git_diff_paired_foreach, temporarily resort the index->workdir diff list by index path so that we can track a rename in the workdir from head->index->workdir.
* | | | Merge pull request #1462 from yorah/fix/libgit2sharp-issue-379Russell Belfer2013-08-091-0/+34
|\ \ \ \ | | | | | | | | | | status: fix handling of filenames with special prefixes
| * | | | status: fix handling of filenames with special prefixesyorah2013-04-151-0/+34
| | | | | | | | | | | | | | | | | | | | Fix libgit2/libgit2sharp#379
* | | | | Merge pull request #1771 from nvloff/write_empty_config_valueRussell Belfer2013-08-081-0/+17
|\ \ \ \ \ | | | | | | | | | | | | config: allow setting empty string as value
| * | | | | config: allow empty string as valueNikolai Vladimirov2013-08-081-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `git_config_set_string(config, "config.section", "")` fails when escaping the value. The buffer in `escape_value` is allocated without NULL-termination. And in case of empty string 0 is passed for buffer size in `git_buf_grow`. `git_buf_detach` returns NULL when the allocated size is 0 and that leads to an error return in `GITERR_CHECK_ALLOC` called after `escape_value` The change in `config_file.c` was suggested by Russell Belfer <rb@github.com>
* | | | | | Merge pull request #1738 from libgit2/diff-patch-content-sizeBen Straub2013-08-081-20/+39
|\ \ \ \ \ \ | | | | | | | | | | | | | | Add API for getting at git_diff_patch->content_size
| * | | | | | Add hunk/file headers to git_diff_patch_sizeRussell Belfer2013-07-231-29/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows git_diff_patch_size to account for hunk headers and file headers in the returned size. This required some refactoring of the code that is used to print file headers so that it could be invoked by the git_diff_patch_size API. Also this increases the test coverage and fixes an off-by-one bug in the size calculation when newline changes happen at the end of the file.
| * | | | | | Add git_diff_patch_size() APIRussell Belfer2013-07-221-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new API to get the size in bytes of the diffs in a git_diff_patch object.
* | | | | | | Merge pull request #1746 from libgit2/rename-detection-performanceBen Straub2013-08-084-22/+321
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Rename detection slow
| * | | | | | | Move slow tests to "stress" clar moduleRussell Belfer2013-08-052-147/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a new section of clar tests "stress" that will default to being off where we can put slow tests that push the library for performance testing purposes.
| * | | | | | | Restore commented out testsRussell Belfer2013-08-041-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This restores the commented out tests (even though they're slow) and fixes some trailing whitespace.
| * | | | | | | Rename test for rename from rewriteEdward Thomson2013-08-041-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A rename test that illustrates a rename from a rewrite.
| * | | | | | | Rename test for multiple similar matchesEdward Thomson2013-08-041-3/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A rename test that illustrates a source matching multiple targets.
| * | | | | | | Major rename detection changesRussell Belfer2013-07-313-43/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After doing further profiling, I found that a lot of time was being spent attempting to insert hashes into the file hash signature when using the rolling hash because the rolling hash approach generates a hash per byte of the file instead of one per run/line of data. To optimize this, I decided to convert back to a run-based file signature algorithm which would be more like core Git. After changing this, a number of the existing tests started to fail. In some cases, this appears to have been because the test was coded to be too specific to the particular results of the file similarity metric and in some cases there appear to have been bugs in the core rename detection code where only by the coincidence of the file similarity scoring were the expected results being generated. This renames all the variables in the core rename detection code to be more consistent and hopefully easier to follow which made it a bit easier to reason about the behavior of that code and fix the problems that I was seeing. I think it's in better shape now. There are a couple of tests now that attempt to stress test the rename detection code and they are quite slow. Most of the time is spent setting up the test data on disk and in the index. When we roll out performance improvements for index insertion, it should also speed up these tests I hope.
| * | | | | | | Fix rename detection for tree-to-tree diffsRussell Belfer2013-07-241-2/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The performance improvements I introduced for rename detection were not able to run successfully for tree-to-tree diffs because the blob size was not known early enough and so the file signature always had to be calculated nonetheless. This change separates loading blobs into memory from calculating the signature. I can't avoid having to load the large blobs into memory, but by moving it forward, I'm able to avoid the signature calculation if the blob won't come into play for renames.
| * | | | | | | Add rename test that used to be really slowRussell Belfer2013-07-241-0/+57
| | |_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before the optimization commits, this test used to take about 20 seconds to run on my machine. Afterwards, there is still a couple seconds of data setup, but the actual diff and rename detection runs in a fraction of a second.
* | | | | | | odb_pack: handle duplicate objects from different packsBrodie Rao2013-08-084-0/+4
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is based on 24634c6fd02b2240e4a93fad70a08220f8fb793a. This also corrects an issue with error codes being mixed up with the number of found objects.
* | | | | | Parse config headers with quoted quotesEdward Thomson2013-08-071-5/+16
| |_|/ / / |/| | | | | | | | | | | | | | | | | | | Parse config headers that have the last quote on the line quoted instead of walking off the end.
* | | | | Merge pull request #1765 from arrbee/ambiguous-oidsRussell Belfer2013-08-058-1/+66
|\ \ \ \ \ | | | | | | | | | | | | More tests for ambiguous OIDs across packs
| * | | | | More tests for ambiguous OIDs across packsRussell Belfer2013-08-058-1/+66
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test coverage for ambiguous OIDs was pretty thin. This adds a bunch of new objects both in packs, across packs, and loose that match to 8 characters so that we can test various cases of ambiguous lookups.
* | | | | submodule: check alloc and name presenseNikolai Vladimirov2013-08-051-0/+3
|/ / / /
* | | | Update init and clean for revwalk::basic testsRussell Belfer2013-07-221-12/+38
| | | | | | | | | | | | | | | | | | | | The new tests don't always want to use the same fixture data as the old ones so this makes it configurable on a per-test basis.
* | | | git_reference_next_name must match git_reference_nextRussell Belfer2013-07-221-0/+22
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | The git_reference_next API silently skips invalid references when scanning the loose refs. The git_reference_next_name API should skip the same ones even though it isn't creating the reference object. This adds a test with a an invalid loose reference and makes sure that both APIs skip the same entries and generate the same results.
* | | Merge pull request #1726 from crazymaster/developmentBen Straub2013-07-191-2/+5
|\ \ \ | | | | | | | | git_buf_text_gather_stats doesn't work for multi-byte characters
| * | | Fixcrazymaster2013-07-151-2/+2
| | | |
| * | | Fix typocrazymaster2013-07-151-2/+2
| | | |
| * | | Revert "Replace Japanese characters with the encoded hexadecimal values"crazymaster2013-07-151-2/+2
| | | | | | | | | | | | | | | | This reverts commit a91e4d6b21e141c2abc76b65b2d4c91d5d3e03cc.
| * | | Replace Japanese characters with the encoded hexadecimal valuescrazymaster2013-07-151-2/+2
| | | |
| * | | Add test for multi-byte characterscrazymaster2013-07-141-2/+5
| | | |
* | | | revparse: Don't return a reference when asked for a git objectnulltoken2013-07-131-0/+41
|/ / / | | | | | | | | | Fix #1722
* | | tests: Fix memory leaknulltoken2013-07-131-0/+1
| |/ |/|
* | Fix warnings on Win64Russell Belfer2013-07-111-7/+7
| |
* | Untracked directories with .git should be ignoredRussell Belfer2013-07-106-63/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This restores a behavior that was accidentally lost during some diff refactoring where an untracked directory that contains a .git item should be treated as IGNORED, not as UNTRACKED. The submodule code already detects this, but the diff code was not handling the scenario right. This also updates a number of existing tests that were actually exercising the behavior but did not have the right expectations in place. It actually makes the new `test_diff_submodules__diff_ignore_options` test feel much better because the "not-a-submodule" entries are now ignored instead of showing up as untracked items. Fixes #1697
* | Add tests for diff.ignoreSubmdules configRussell Belfer2013-07-101-0/+29
| |
* | Add ignore_submodules to diff optionsRussell Belfer2013-07-103-8/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds correct support for an equivalent to --ignore-submodules in diff, where an actual ignore value can be passed to diff to override the per submodule settings in the configuration. This required tweaking the constants for ignore values so that zero would not be used and could represent an unset option to the diff. This was an opportunity to move the submodule values into include/git2/types.h and to rename the poorly named DEFAULT values for ignore and update constants to RESET instead. Now the GIT_DIFF_IGNORE_SUBMODULES flag is exactly the same as setting the ignore_submodules option to GIT_SUBMODULE_IGNORE_ALL (which is actually a minor change from the old behavior in that submodules will now be treated as UNMODIFIED deltas instead of being left out totally - if you set GIT_DIFF_INCLUDE_UNMODIFIED). This includes tests for the various new settings.
* | Update diff to new internal submodule status APIRussell Belfer2013-07-101-7/+0
| | | | | | | | | | | | | | Submodules now expose an internal status API that allows diff to get back the OID values from the submodule very easily and also to avoiding caching issues and to override the ignore setting for the submodule.
* | Add BARE option to git_repository_open_extRussell Belfer2013-07-101-4/+61
| | | | | | | | | | | | | | | | | | | | | | This adds a BARE option to git_repository_open_ext which allows a fast open path that still knows how to read gitlinks and to search for the actual .git directory from a subdirectory. `git_repository_open_bare` is still simpler and faster, but having a gitlink aware fast open is very useful for submodules where we want to quickly be able to peek at the HEAD and index data without doing any other meaningful repo operations.
* | Add timestamp check to submodule statusRussell Belfer2013-07-101-4/+9
| | | | | | | | | | | | | | | | This is probably not the final form of this change, but this is a preliminary version of checking a timestamp to see if the cached working directory HEAD OID matches the current. Right now, this uses the timestamp on the index and is, like most of our timestamp checking, subject to having only second accuracy.
* | More diff submodule tests for cache issuesRussell Belfer2013-07-101-0/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | The submodules code caches data about submodules in a way that can cause problems. This adds some tests that try making various modifications to the state of a submodule to see where we can catch out problems in the submodule caching. Right now, I've put in an extra git_submodule_reload_all so that the test will pass, but with that commented out, the test fails. I'm working on fixing the broken version of the test at which point I'll commit the fix and delete the extra reload that makes the test pass.
* | Fix diff test helper to show parent file/lineRussell Belfer2013-07-101-6/+13
| |
* | Fix memory leak in testRussell Belfer2013-07-101-0/+1
| |
* | More improvements to submodule diff testsRussell Belfer2013-07-101-5/+23
| | | | | | | | | | | | This controls for the diff.mnemonicprefix setting so that can't break the tests. Also, this expands one test to emulate an ObjectiveGit test more closely.
* | Add another submodule test of dirty wdRussell Belfer2013-07-101-0/+39
| |
* | Add git_pathspec_match_diff APIRussell Belfer2013-07-101-0/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds an additional pathspec API that will match a pathspec against a diff object. This is convenient if you want to handle renames (so you need the whole diff and can't use the pathspec constraint built into the diff API) but still want to tell if the diff had any files that matched the pathspec. When the pathspec is matched against a diff, instead of keeping a list of filenames that matched, instead the API keeps the list of git_diff_deltas that matched and they can be retrieved via a new API git_pathspec_match_list_diff_entry. There are a couple of other minor API extensions here that were mostly for the sake of convenience and to reduce dependencies on knowing the internal data structure between files inside the library.