summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* tag: allow the tagger field to be missing when parsing tagsBrodie Rao2011-10-121-2/+18
| | | | | | | | | Instead of bailing out with an error, this sets tagger to NULL when the field is missing from the object. This makes it possible to inspect tags like this one: http://git.kernel.org/?p=git/git.git;a=tag;h=f25a265a342aed6041ab0cc484224d9ca54b6f41
* tag: avoid a double-free when parsing tags without a tagger fieldBrodie Rao2011-10-126-0/+27
| | | | | | | | | | | | | | | | | | | | The v0.99 tag in the Git repo triggers this behavior: http://git.kernel.org/?p=git/git.git;a=tag;h=d6602ec5194c87b0fc87103ca4d67251c76f233a Ideally, we'd allow the tag to be instantiated even though the tagger field is missing, but this at the very least prevents libgit2 from crashing. To test this bug, a new repository has been added based on the test branch in testrepo.git. It contains a "e90810b" tag that looks like this: object e90810b8df3e80c413d903f631643c716887138d type commit tag e90810b This is a very simple tag.
* commit: properly parse empty commit messagesBrodie Rao2011-10-126-2/+8
| | | | | | | | | This ensures commit->message is always non-NULL, even if the commit message is empty or consists of only a newline. One such commit can be found in the wild in the jQuery repository: https://github.com/jquery/jquery/commit/25b424134f9927a5bf0bab5cba836a0aa6c3cfc1
* config: behave like git with [section.subsection]Carlos Martín Nieto2011-10-012-4/+22
| | | | | | | | The documentation is a bit misleading. The subsection name is always case-sensitive, but with a [section.subsection] header, the subsection is transformed to lowercase when the configuration is parsed. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* core: One last `long long`config-int-typesVicent Marti2011-09-301-2/+2
|
* config: Proper type declarations for 64 bit intsVicent Marti2011-09-301-32/+32
|
* Make repo config loading automatic or completely explicitCarlos Martín Nieto2011-09-272-48/+7
| | | | | | | | | | | git_repository_config wants to take the global and system paths again so that one can be explicit if needed. The git_repository_config_autoload function is provided for the cases when it's good enough for the library to guess where those files are located. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Merge pull request #427 from schu/fix-unused-parametersVicent Martí2011-09-271-3/+3
|\ | | | | t18-status.c: fix unused warnings
| * t18-status.c: fix unused warningsschu2011-09-241-3/+3
| | | | | | | | Signed-off-by: schu <schu-github@schulog.org>
* | Revert "Rewrite getenv to use Win32 version on Windows"Vicent Marti2011-09-272-6/+6
|/ | | | This reverts commit e1b86444676b70154bf8ab450d429bdef57a8276.
* config: make git_config_[get|set]_long() able to properly deal with 8 bytes ↵nulltoken2011-09-223-1/+64
| | | | | | | | wide values Should fix issue #419. Signed-off-by: nulltoken <emeric.fermas@gmail.com>
* Rewrite getenv to use Win32 version on WindowsPaul Betts2011-09-212-6/+6
|
* refs: add additional test for reference renamingschu2011-09-201-0/+30
| | | | | Signed-off-by: nulltoken <emeric.fermas@gmail.com> Signed-off-by: schu <schu-github@schulog.org>
* Fix tests to use portable setenvPaul Betts2011-09-192-12/+14
|
* Merge pull request #384 from kiryl/warningsVicent Martí2011-09-185-11/+9
|\ | | | | Add more -W flags to CFLAGS
| * CMakefile: add -Wmissing-prototypes and fix warningsKirill A. Shutemov2011-08-304-10/+8
| | | | | | | | Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
| * CMakefile: add -Wstrict-prototypes and fix warningsKirill A. Shutemov2011-08-301-1/+1
| | | | | | | | Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* | Merge pull request #398 from carlosmn/config-autohomeVicent Martí2011-09-182-6/+48
|\ \ | | | | | | git_repository_config: open global config file automatically
| * | git_repository_config: open global config file automaticallyCarlos Martín Nieto2011-09-122-6/+48
| |/ | | | | | | | | | | If the global configuration file is missing, it is ignored. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* | Add some forgotten asserts in the status testsnulltoken2011-09-171-4/+4
| |
* | Fix a off-by-one error in the git_status_foreach testsnulltoken2011-09-171-1/+1
| | | | | | | | Provided the tests fail (which they should not) and the callback is invoked too many times, this prevents the tests from segfaulting.
* | Revert changes to t18Vicent Marti2011-09-161-1/+36
| | | | | | | | ...Ops, I broke the old test when porting it to Clay.
* | Add sample "Status" clay testsVicent Marti2011-09-161-36/+1
| |
* | status: enhance determination of statuses for a whole directorynulltoken2011-09-151-29/+230
| | | | | | | | | | - Should increase performance through usage of a walker - No callback invocation for unaltered entries
* | status: enhance determination of status for a single filenulltoken2011-09-153-2/+64
| | | | | | | | | | | | - fix retrieval of a file status when working against a newly initialized repository - reduce memory pressure - prevents a directory from being tested
* | Mark the resources in the test folder as binary to prevent unexpected ↵nulltoken2011-09-151-0/+1
|/ | | | line-feed conversion
* Drop STRLEN() macrosKirill A. Shutemov2011-08-251-1/+1
| | | | | | | There is no need in STRLEN macros. Compilers can do this trivial optimization on its own. Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* reflog: assimilate reflog API to return git_oid'sschu2011-08-151-4/+10
| | | | | | | Rather than returning the OIDs out of the reflog as string return them as git_oid. Signed-off-by: schu <schu-github@schulog.org>
* commit: Add support for Encoding headerVicent Marti2011-08-121-3/+3
|
* t12-repo.c: fix failing test discover0schu2011-08-101-1/+1
| | | | | | discover0 tried to stat a non existing directory. Create it beforehand. Signed-off-by: schu <schu-github@schulog.org>
* discover: Make test run in temporary folder instead of altering the test ↵nulltoken2011-08-091-3/+3
| | | | resources folder
* Fix compilation in WindowsVicent Marti2011-08-081-7/+4
|
* Force the test's main function to use cdecl under WindowsCarlos Martín Nieto2011-08-061-1/+6
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Fix wrong test in t04-commitLambert CLARA2011-08-042-11/+11
| | | | Replace all must_pass(strcmp()) by must_be_true(strcmp()==0)
* signature: adjust API to return error codesschu2011-08-033-29/+15
| | | | | | | | git_signature_new() and git_signature_now() currently don't return error codes. Change the API to return error codes and not pointers to let the user handle errors properly. Signed-off-by: schu <schu-github@schulog.org>
* signature.c: fix off-by-one errorschu2011-08-031-0/+28
| | | | Signed-off-by: schu <schu-github@schulog.org>
* Fix memory leak when wrong object type is looked up from cacheLambert CLARA2011-08-021-1/+4
| | | | Update unit test accordingly : no need to close
* reflog: avoid users writing a wrong ancestor OIDschu2011-08-011-0/+29
| | | | | | | Disallow NULL as ancestor OID when writing a reflog entry for an existing reference. Signed-off-by: schu <schu-github@schulog.org>
* Remove extra git_index_read from the testsCarlos Martín Nieto2011-07-261-11/+0
| | | | | | | | When you open an index with git_index_open, the file is read before the function returns. Thus, calling git_index_read after that is useless. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* tests: fix cast warningsKirill A. Shutemov2011-07-255-35/+36
| | | | | | | | | | | | | | | | | | | | | | | | /home/kas/git/public/libgit2/tests/t00-core.c: In function ‘test_cmp’: /home/kas/git/public/libgit2/tests/t00-core.c:78:10: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] /home/kas/git/public/libgit2/tests/t00-core.c:78:22: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] /home/kas/git/public/libgit2/tests/t07-hashtable.c: In function ‘hash_func’: /home/kas/git/public/libgit2/tests/t07-hashtable.c:42:7: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] /home/kas/git/public/libgit2/tests/t08-tag.c: In function ‘_gittest__write0’: /home/kas/git/public/libgit2/tests/t08-tag.c:141:21: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] /home/kas/git/public/libgit2/tests/t08-tag.c: In function ‘_gittest__write2’: /home/kas/git/public/libgit2/tests/t08-tag.c:192:21: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] /home/kas/git/public/libgit2/tests/t08-tag.c: In function ‘_gittest__write3’: /home/kas/git/public/libgit2/tests/t08-tag.c:227:21: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] /home/kas/git/public/libgit2/tests/t04-commit.c: In function ‘_gittest__write0’: /home/kas/git/public/libgit2/tests/t04-commit.c:650:21: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] /home/kas/git/public/libgit2/tests/t04-commit.c:651:21: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] /home/kas/git/public/libgit2/tests/t04-commit.c: In function ‘_gittest__root0’: /home/kas/git/public/libgit2/tests/t04-commit.c:723:21: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] /home/kas/git/public/libgit2/tests/t04-commit.c:724:21: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] /home/kas/git/public/libgit2/tests/t12-repo.c: In function ‘write_file’: /home/kas/git/public/libgit2/tests/t12-repo.c:360:24: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* Merge pull request #325 from carlosmn/valgrindVicent Martí2011-07-131-0/+1
|\ | | | | More memory leaks
| * Free sig in reflog testCarlos Martín Nieto2011-07-131-0/+1
| | | | | | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* | tree: fix insertion of entries with invalid filenamesnulltoken2011-07-131-0/+5
|/
* status: refactor the tests to remove some code duplicationnulltoken2011-07-123-63/+32
|
* Don't leak the buf when testing itCarlos Martín Nieto2011-07-121-0/+2
| | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* config: Rename `del` to `deleteVicent Marti2011-07-121-4/+4
|
* tag: Add creation of lightweight tagnulltoken2011-07-111-3/+61
|
* What the fuck was this doing in `src`?Vicent Marti2011-07-111-0/+344
|
* reflog: Fix reflog writer/readernulltoken2011-07-103-38/+52
| | | | | | - Use a space to separate oids and signature - Enforce test coverage - Make test run in a temporary folder in order not to alter the test repository
* status: CleanupVicent Marti2011-07-091-1/+1
| | | | | | | | The `hashfile` function has been moved to ODB, next to `git_odb_hash`. Global state has been removed from the dirent call in `status.c`, because global state is killing the rainforest and causing global warming.