summaryrefslogtreecommitdiff
path: root/tests-clay
Commit message (Collapse)AuthorAgeFilesLines
* Rename the Clay test suite to ClarVicent Martí2012-01-2453-6193/+0
| | | | | Clay is the name of a programming language on the makings, and we want to avoid confusions. Sorry for the huge diff!
* remote: add test which creates a basic remote entry in the repository ↵nulltoken2012-01-231-0/+33
| | | | configuration then loads the remote
* Merge branch 'fix-subdir-attr-paths' into developmentRussell Belfer2012-01-204-39/+102
|\ | | | | | | This resolves issue #535 and issue #533.
| * Fix handling of relative paths for attrsRussell Belfer2012-01-164-39/+102
| | | | | | | | | | | | | | | | | | | | | | | | 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-173-8/+8
|/ | | | | | | | | | | 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).
* Patch cleanup for mergeRussell Belfer2012-01-161-3/+3
| | | | | | | | | | After reviewing the gitignore support with Vicent, we came up with a list of minor cleanups to prepare for merge, including: * checking git_repository_config error returns * renaming git_ignore_is_ignored and moving to status.h * fixing next_line skipping to include \r skips * commenting on where ignores are and are not included
* Convert git_path_walk_up to regular functionRussell Belfer2012-01-111-6/+22
| | | | | | This gets rid of the crazy macro version of git_path_walk_up and makes it into a normal function that takes a callback parameter. This turned out not to be too messy.
* Allow ignores (and attribs) for nonexistent filesRussell Belfer2012-01-112-0/+18
| | | | | | 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.
* Initial implementation of gitignore supportRussell Belfer2012-01-113-1/+52
| | | | | | | | 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 pull request #528 from arrbee/valgrind-fixes-2Vicent Martí2012-01-051-1/+0
|\ | | | | Valgrind fixes in smaller pieces
| * Remove repo open immediately after init in testRussell Belfer2012-01-051-1/+0
| | | | | | | | | | Calling git_repository_open immediately after git_repository_init results in memory leaks.
* | clay tests: free resourcesCarlos Martín Nieto2012-01-063-0/+4
|/ | | | Trees, indices and repos need to be freed
* Merge remote-tracking branch 'nulltoken/topix/path_fromurl' into developmentVicent Martí2012-01-044-28/+138
|\ | | | | | | | | | | Conflicts: tests-clay/clay.h tests-clay/clay_main.c
| * transport: make local transport accept a file Uri containing percent-encoded ↵nulltoken2011-12-283-11/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | characters This makes libgit2 compliant with the following scenario $ git ls-remote file:///d:/temp/dwm%20tinou 732d790b702db4b8985f5104fc44642654f6a6b6 HEAD 732d790b702db4b8985f5104fc44642654f6a6b6 refs/heads/master 732d790b702db4b8985f5104fc44642654f6a6b6 refs/remotes/origin/HEAD 732d790b702db4b8985f5104fc44642654f6a6b6 refs/remotes/origin/master $ mv "/d/temp/dwm tinou" /d/temp/dwm+tinou $ git ls-remote file:///d:/temp/dwm%20tinou fatal: 'd:/temp/dwm tinou' does not appear to be a git repository fatal: The remote end hung up unexpectedly $ git ls-remote file:///d:/temp/dwm+tinou 732d790b702db4b8985f5104fc44642654f6a6b6 HEAD 732d790b702db4b8985f5104fc44642654f6a6b6 refs/heads/master 732d790b702db4b8985f5104fc44642654f6a6b6 refs/remotes/origin/HEAD 732d790b702db4b8985f5104fc44642654f6a6b6 refs/remotes/origin/master
| * path: add git_path_fromurl()nulltoken2011-12-283-26/+67
| |
| * path: add git__percent_decode()nulltoken2011-12-283-3/+29
| |
| * util: add git__fromhex()nulltoken2011-12-284-15/+36
| |
* | Fix MSVC compilation warningsnulltoken2012-01-041-2/+4
| |
* | clay: Move `file_create` to the helpers fileVicent Martí2012-01-028-53/+27
| |
* | Merge remote-tracking branch 'drizzd/diff-index-tests' into developmentVicent Martí2012-01-028-1446/+100
|\ \ | | | | | | | | | | | | | | | Conflicts: tests-clay/clay.h tests-clay/clay_main.c
| * | add diff-index testsClemens Buchacher2011-12-301-4/+14
| | |
| * | clay: reset expect_idx in diff_more testClemens Buchacher2011-12-301-6/+13
| | | | | | | | | | | | | | | | | | For the diff-index tests, the diff_more test will run multiple times. Reset the expect_idx counter after each test in order to allow this.
| * | add git_index_read_treeClemens Buchacher2011-12-304-10/+73
| | |
| * | cmake: generate clay mainClemens Buchacher2011-12-293-1365/+1
| |/ | | | | | | | | | | The clay test suite files clay.h and clay_main.c are generated by the clay python script. Teach CMake about this dependency and remove the generated files from the repository.
* | Merge remote-tracking branch 'arrbee/git-attributes' into developmentVicent Martí2012-01-026-4/+907
|\ \ | |/ |/| | | | | Conflicts: tests-clay/clay_main.c
| * Improved gitattributes macro implementationRussell Belfer2011-12-304-7/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-295-38/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-205-2/+663
| | | | | | | | | | | | | | | | | | 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.
* | remotes: Remove unused variablesVicent Martí2011-12-251-0/+1
| |
* | refs: Fix double freeVicent Martí2011-12-253-2/+27
| | | | | | | | Includes relevant Clay test
* | remote: add test to retrieve the advertised references from a local ↵nulltoken2011-12-213-2/+85
|/ | | | repository and fix related implementation
* Add unit test for proper init of index entriesRussell Belfer2011-12-181-0/+11
|
* Update to Clay 0.10.0Vicent Marti2011-12-154-19/+88
| | | | Comes with support for global events; this fixes #496.
* Allow git_buf_joinpath to accept self-joinsRussell Belfer2011-12-143-20/+61
| | | | | | | | | | | | 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
* commit: add test to ensure predictability of generation of commit, tree and ↵nulltoken2011-12-144-72/+130
| | | | blob object ids
* Merge remote-tracking branch 'nulltoken/topic/oid-generation' into developmentVicent Marti2011-12-143-2/+74
|\ | | | | | | | | | | Conflicts: tests-clay/clay.h tests-clay/clay_main.c
| * tree: add test to ensure predictability of generation of object idsnulltoken2011-12-043-2/+74
| |
* | Merge remote-tracking branch 'arrbee/git-buf-for-paths' into developmentVicent Marti2011-12-099-87/+226
|\ \ | | | | | | | | | | | | Conflicts: tests-clay/clay_main.c
| * | Use git_buf for path storage instead of stack-based buffersRussell Belfer2011-12-079-87/+226
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This converts virtually all of the places that allocate GIT_PATH_MAX buffers on the stack for manipulating paths to use git_buf objects instead. The patch is pretty careful not to touch the public API for libgit2, so there are a few places that still use GIT_PATH_MAX. This extends and changes some details of the git_buf implementation to add a couple of extra functions and to make error handling easier. This includes serious alterations to all the path.c functions, and several of the fileops.c ones, too. Also, there are a number of new functions that parallel existing ones except that use a git_buf instead of a stack-based buffer (such as git_config_find_global_r that exists alongsize git_config_find_global). This also modifies the win32 version of p_realpath to allocate whatever buffer size is needed to accommodate the realpath instead of hardcoding a GIT_PATH_MAX limit, but that change needs to be tested still.
* | clay: add tests for tree diff'ingCarlos Martín Nieto2011-12-033-2/+170
|/ | | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk> Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Fix compilation warningsnulltoken2011-12-011-2/+2
|
* Optimized of git_buf_join.Russell Belfer2011-11-304-16/+51
| | | | | | | This streamlines git_buf_join and removes the join-append behavior, opting instead for a very compact join-replace of the git_buf contents. The unit tests had to be updated to remove the join-append tests and have a bunch more exhaustive tests added.
* Make initial value of git_buf ptr always be a valid empty string.Russell Belfer2011-11-291-6/+3
| | | | | | | | | | | | Taking a page from core git's strbuf, this introduces git_buf_initbuf which is an empty string that is used to initialize the git_buf ptr value even for new buffers. Now the git_buf ptr will always point to a valid NUL-terminated string. This change required jumping through a few hoops for git_buf_grow and git_buf_free to distinguish between a actual allocated buffer and the global initial value. Also, this moves the allocation related functions to be next to each other near the top of buffer.c.
* Adding unit tests for git_buf_copy_cstrRussell Belfer2011-11-291-0/+22
|
* Make git_buf functions always maintain a valid cstr.Russell Belfer2011-11-291-5/+4
| | | | | | | | | At a tiny cost of 1 extra byte per allocation, this makes git_buf_cstr into basically a noop, which simplifies error checking when trying to convert things to use dynamic allocation. This patch also adds a new function (git_buf_copy_cstr) for copying the cstr data directly into an external buffer.
* clay: Add buffer testsVicent Marti2011-11-292-2/+28
|
* Merge pull request #499 from arrbee/extend-git-bufVicent Martí2011-11-292-0/+490
|\ | | | | Extend git_buf with new utility functions and unit tests.
| * Resolve remaining feedbackRussell Belfer2011-11-281-6/+2
| | | | | | | | | | * replace some ints with size_ts * update NULL checks in various places
| * Add two string git_buf_join and tweak input error checking.Russell Belfer2011-11-281-33/+76
| | | | | | | | | | | | | | | | This commit addresses two of the comments: * renamed existing n-input git_buf_join to git_buf_join_n * added new git_buf_join that always takes two inputs * moved some parameter error checking to asserts * extended unit tests to cover new version of git_buf_join
| * Extend git_buf with new utility functions and unit tests.Russell Belfer2011-11-272-0/+451
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new functions to git_buf for: * initializing a buffer from a string * joining one or more strings onto a buffer with separators * swapping two buffers in place * extracting data from a git_buf (leaving it empty) Also, make git_buf_free leave a git_buf back in its initted state, and slightly tweak buffer allocation sizes and thresholds. Finally, port unit tests to clay and extend with lots of new tests for the various git_buf functions.