summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Backport more test dataVicent Martí2012-05-0266-57/+0
|
* Move test resourcesVicent Martí2012-05-0298-130/+0
|
* Merge branch 'new-error-handling' into developmentVicent Martí2012-05-02111-0/+144
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .travis.yml include/git2/diff.h src/config_file.c src/diff.c src/diff_output.c src/mwindow.c src/path.c tests-clar/clar_helpers.c tests-clar/object/tree/frompath.c tests/t00-core.c tests/t03-objwrite.c tests/t08-tag.c tests/t10-refs.c tests/t12-repo.c tests/t18-status.c tests/test_helpers.c tests/test_main.c
| * Merge pull request #642 from arrbee/mem-poolsRussell Belfer2012-04-252-191/+0
| |\ | | | | | | Memory pools and khash hashtables
| | * Rename git_khash_str to git_strmap, etc.Russell Belfer2012-04-252-191/+0
| | | | | | | | | | | | | | | | | | This renamed `git_khash_str` to `git_strmap`, `git_hash_oid` to `git_oidmap`, and deletes `git_hashtable` from the tree, plus adds unit tests for `git_strmap`.
| * | Include the new config test fileCarlos Martín Nieto2012-04-251-0/+2
| |/
| * Fix warnings on 64-bit windows buildsRussell Belfer2012-04-172-2/+2
| | | | | | | | | | This fixes all the warnings on win64 except those in deps, which come from the regex code.
| * config: parse quoted valuesCarlos Martín Nieto2012-04-161-0/+7
| | | | | | | | | | Variable values may be quoted to include newlines, literal quotes and other characters. Add support for these and test it.
| * tag: Add git_tag_peel() which recursively peel a tag until a non tag ↵nulltoken2012-04-104-6/+7
| | | | | | | | git_object is met
| * Merge pull request #610 from arrbee/status-rewriteVicent Martí2012-03-31111-1/+139
| |\ | | | | | | Rewrite status using diff
| | * Fix handling of submodules in treesRussell Belfer2012-03-266-0/+6
| | |
| | * Fix error in tree iterator when popping up treesRussell Belfer2012-03-2513-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was an error in the tree iterator where it would delete two tree levels instead of just one when popping up a tree level. Unfortunately the test data for the tree iterator did not have any deep trees with subtrees in the middle of the tree items, so this problem went unnoticed. This contains the 1-line fix plus new test data and tests that reveal the issue.
| | * Restore default status recursion behaviorRussell Belfer2012-03-231-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | This gives `git_status_foreach()` back its old behavior of emulating the "--untracked=all" behavior of git. You can get any of the various --untracked options by passing flags to `git_status_foreach_ext()` but the basic version will keep the behavior it has always had.
| | * More status testingRussell Belfer2012-03-221-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This "fixes" the broken t18 status tests to accurately reflect the new behavior for "created" untracked subdirectories. See discussion in the PR for more details. This also contains the submodules unit test that I forgot to git add, and ports most of the t18-status.c tests to clar (still missing a couple of the git_status_file() single file tests).
| | * Adding new tests for new status commandRussell Belfer2012-03-2295-0/+124
| | | | | | | | | | | | | | | | | | | | | | | | This is a work in progress. This adds two new sets of tests, the issue_592 tests from @nulltoken's pull request #601 and some new tests for submodules. The submodule tests still have issues where the status is not reported correctly. That needs to be fixed before merge.
| * | test_helpers: fix unepextected closing of file on errornulltoken2012-03-211-1/+2
| |/
| * Convert attr, ignore, mwindow, status to new errorsRussell Belfer2012-03-161-1/+1
| | | | | | | | | | Also cleaned up some previously converted code that still had little things to polish.
| * error-handling: RepositoryVicent Martí2012-03-071-2/+6
| | | | | | | | | | | | | | | | This also includes droping `git_buf_lasterror` because it makes no sense in the new system. Note that in most of the places were it has been dropped, the code needs cleanup. I.e. GIT_ENOMEM is going away, so instead it should return a generic `-1` and obviously not throw anything.
| * error-handling: ReferencesVicent Martí2012-03-066-22/+32
| | | | | | | | | | Yes, this is error handling solely for `refs.c`, but some of the abstractions leak all ofer the code base.
* | Merge pull request #606 from benstraub/t04_commit_to_clarVicent Martí2012-04-0253-0/+43
|\ \ | | | | | | Ported t04_commit.c to Clar.
| * | Ported t04_commit.c to Clar.Ben Straub2012-03-2053-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Created a copy of tests/resources/testrepo.git that is compatible with the Clar sandboxing helpers. Restructured commit test suites to use Clar sandbox helpers. Now using typed data arrays rather than lots of macros to define test cases.
* | | Moved testing resources to clar, and removed old tests directory.Ben Straub2012-03-31275-1297/+0
| | | | | | | | | | | | Removed the BUILD_CLAR CMake flag, and updated the readme.
* | | Removing test suites that have been ported to Clar:Ben Straub2012-03-3116-6178/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * t00 / 6e86fb3 (mentioned in #406) * t01 / fc60c4a (mentioned in #406) * t03 / bcbabe6 * t04 / PR #606 * t05 / d96f2c3 * t06 / 6c106ee * t07 / 2ef582b * t08 / b482c42 * t09 / 9a39a36 * t10 / 00a4893 * t12 / 7c3a4a7 * t13 / 1cb9b31 * t17 / cdaa6ff (mentioned in #406) * t18 / efabc08
* | | t08_tag.c ported.Ben Straub2012-03-3053-0/+43
|/ / | | | | | | Also cleaned up some names for things that used to be macros.
* | Rename git_oid_to_string to git_oid_tostrAuthmillenon2012-03-062-11/+11
|/ | | | | To conform the naming scheme of git_oid_fromstr we should change the name of git_oid_to_string to git_oid_tostr.
* Revert GIT_STATUS constants to avoid issuesRussell Belfer2012-03-021-3/+3
| | | | | | | | | This reverts the changes to the GIT_STATUS constants and adds a new enumeration to describe the type of change in a git_diff_delta. I don't love this solution, but it should prevent strange errors from occurring for now. Eventually, I would like to unify the various status constants, but it needs a larger plan and I just wanted to eliminate this breakage quickly.
* Clean up GIT_UNUSED macros on all platformsRussell Belfer2012-03-024-14/+11
| | | | | | | | | | | | | | | | | | | It turns out that commit 31e9cfc4cbcaf1b38cdd3dbe3282a8f57e5366a5 did not fix the GIT_USUSED behavior on all platforms. This commit walks through and really cleans things up more thoroughly, getting rid of the unnecessary stuff. To remove the use of some GIT_UNUSED, I ended up adding a couple of new iterators for hashtables that allow you to iterator just over keys or just over values. In making this change, I found a bug in the clar tests (where we were doing *count++ but meant to do (*count)++ to increment the value). I fixed that but then found the test failing because it was not really using an empty repo. So, I took some of the code that I wrote for iterator testing and moved it to clar_helpers.c, then made use of that to make it easier to open fixtures on a per test basis even within a single test file.
* Update diff to use iteratorsRussell Belfer2012-03-021-3/+3
| | | | | | | | | | | | | This is a major reorganization of the diff code. This changes the diff functions to use the iterators for traversing the content. This allowed a lot of code to be simplified. Also, this moved the functions relating to outputting a diff into a new file (diff_output.c). This includes a number of other changes - adding utility functions, extending iterators, etc. plus more tests for the diff code. This also takes the example diff.c program much further in terms of emulating git-diff command line options.
* Add tests and fix bugs for diff whitespace optionsRussell Belfer2012-03-028-4/+15
| | | | | | Once I added tests for the whitespace handling options of diff, I realized that there were some bugs. This fixes those and adds the new tests into the test suite.
* Clean up diff implementation for reviewRussell Belfer2012-03-021-0/+0
| | | | | | | This fixes several bugs, updates tests and docs, eliminates the FILE* assumption in favor of printing callbacks for the diff patch formatter helpers, and adds a "diff" example function that can perform a diff from the command line.
* Initial implementation of git_diff_blobRussell Belfer2012-03-0215-3/+43
| | | | | | | | This gets the basic plumbing in place for git_diff_blob. There is a known issue where additional parameters like the number of lines of context to display on the diff are not working correctly (which leads one of the new unit tests to fail).
* Simplify GIT_UNUSED macrosRussell Belfer2012-03-021-2/+2
| | | | | | | Since casting to void works to eliminate errors with unused parameters on all platforms, avoid the various special cases. Over time, it will make sense to eliminate the GIT_UNUSED macro completely and just have GIT_UNUSED_ARG.
* Add test for possible attr bugRussell Belfer2012-03-022-0/+7
| | | | | This is a test that should replicate an issue that Peff is setting with git attributes. But the test doesn't fail.
* buffer: Unify `git_fbuffer` and `git_buf`Vicent Martí2012-02-271-8/+9
| | | | | | | | | | | | | | This makes so much sense that I can't believe it hasn't been done before. Kill the old `git_fbuffer` and read files straight into `git_buf` objects. Also: In order to fully support 4GB files in 32-bit systems, the `git_buf` implementation has been changed from using `ssize_t` for storage and storing negative values on allocation failure, to using `size_t` and changing the buffer pointer to a magical pointer on allocation failure. Hopefully this won't break anything.
* Implement setting multivarsCarlos Martín Nieto2012-02-171-2/+2
|
* tests: add multivar read testCarlos Martín Nieto2012-02-171-0/+3
|
* Add unit tests for recent bug fixesRussell Belfer2012-02-014-0/+1
| | | | | | Add unit tests to confirm ignore directory pattern matches and to confirm that ignore and attribute files are loaded properly into the attribute file cache.
* threads: Make the old test suite TLS awarenulltoken2012-01-291-0/+4
|
* Merge branch 'fix-subdir-attr-paths' into developmentRussell Belfer2012-01-2013-2/+13
|\ | | | | | | This resolves issue #535 and issue #533.
| * Fix handling of relative paths for attrsRussell Belfer2012-01-1613-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | Per issue #533, the handling of relative paths in attribute and ignore files was not right. Fixed this by pre-joining the relative path of the attribute/ignore file onto the match string when a full path match is required. Unfortunately, fixing this required a bit more code than I would have liked because I had to juggle things around so that the fnmatch parser would have sufficient information to prepend the relative path when it was needed.
* | Move path related functions from fileops to pathRussell Belfer2012-01-175-27/+27
|/ | | | | | | | | | | This takes all of the functions that look up simple data about paths (such as `git_futils_isdir`) and moves them over to path.h (becoming `git_path_isdir`). This leaves fileops.h just with functions that actually manipulate the filesystem or look at the file contents in some way. As part of this, the dir.h header which is really just for win32 support was moved into win32 (with some minor changes).
* Allow ignores (and attribs) for nonexistent filesRussell Belfer2012-01-111-0/+1
| | | | | | This fixes issue 532 that attributes (and gitignores) could not be checked for files that don't exist. It should be possible to query such things regardless of the existence of the file.
* Fix up status testsRussell Belfer2012-01-111-3/+9
|
* Initial implementation of gitignore supportRussell Belfer2012-01-112-0/+3
| | | | | | | | Adds support for .gitignore files to git_status_foreach() and git_status_file(). This includes refactoring the gitattributes code to share logic where possible. The GIT_STATUS_IGNORED flag will now be passed in for files that are ignored (provided they are not already in the index or the head of repo).
* Merge remote-tracking branch 'nulltoken/topix/path_fromurl' into developmentVicent Martí2012-01-041-13/+2
|\ | | | | | | | | | | Conflicts: tests-clay/clay.h tests-clay/clay_main.c
| * util: add git__fromhex()nulltoken2011-12-281-13/+2
| |
* | Improved gitattributes macro implementationRussell Belfer2011-12-3010-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | This updates to implementation of gitattribute macros to be much more similar to core git (albeit not 100%) and to handle expansion of macros within macros, etc. It also cleans up the refcounting usage with macros to be much cleaner. Also, this adds a new vector function `git_vector_insert_sorted()` which allows you to maintain a sorted list as you go. In order to write that function, this changes the function `git__bsearch()` to take a somewhat different set of parameters, although the core functionality is still the same.
* | Add support for macros and cache flush API.Russell Belfer2011-12-2919-7/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for git attribute macro definitions. Also, add support for cache flush API to clear the attribute file content cache when needed. Additionally, improved the handling of global and system files, making common utility functions in fileops and converting config and attr to both use the common functions. Adds a bunch more tests and fixed some memory leaks. Note that adding macros required me to use refcounted attribute assignment definitions, which complicated, but probably improved memory usage.
* | Add APIs for git attributesRussell Belfer2011-12-2036-0/+92
|/ | | | | | | | | This adds APIs for querying git attributes. In addition to the new API in include/git2/attr.h, most of the action is in src/attr_file.[hc] which contains utilities for dealing with a single attributes file, and src/attr.[hc] which contains the implementation of the APIs that merge all applicable attributes files.
* Allow git_buf_joinpath to accept self-joinsRussell Belfer2011-12-141-1/+1
| | | | | | | | | | | | It was not safe for git_buf_joinpath to be used with a pointer into the buf itself because a reallocation could invalidate the input parameter that pointed into the buffer. This patch makes it safe to self join, at least for the leading input to the join, which is the common "append" case for self joins. Also added unit tests to explicitly cover this case. This should actually fix #511