summaryrefslogtreecommitdiff
path: root/tests-clar/index
Commit message (Collapse)AuthorAgeFilesLines
* Rename tests-clar to testsBen Straub2013-11-1410-1936/+0
|
* move mode_t to filebuf_open instead of _commitEdward Thomson2013-11-041-3/+3
|
* Convert git_index_read to have a "force" flagRussell Belfer2013-11-012-14/+15
| | | | | This is a little more intuitive than the turned-around option that I originally wrote.
* Make diff and status perform soft index reloadRussell Belfer2013-11-014-21/+30
| | | | | | | | | | | | | | | | | | | | | This changes `git_index_read` to have two modes - a hard index reload that always resets the index to match the on-disk data (which was the old behavior) and a soft index reload that uses the timestamp / file size information and only replaces the index data if the file on disk has been modified. This then updates the git_status code to do a soft reload unless the new GIT_STATUS_OPT_NO_REFRESH flag is passed in. This also changes the behavior of the git_diff functions that use the index so that when an index is not explicitly passed in (i.e. when the functions call git_repository_index for you), they will also do a soft reload for you. This intentionally breaks the file signature of git_index_read because there has been some confusion about the behavior previously and it seems like all existing uses of the API should probably be examined to select the desired behavior.
* Prevent checkout_tree when conflicts exist, clear NAME on checkout treeEdward Thomson2013-10-161-0/+64
| | | | | | | Prevent checkout tree when unresolved changes exist (unless FORCE flag is specified). Clear NAME table when checking out, to avoid checkout_conflicts from attempting to manipulate it. Ensure that NAME is also cleared at reset.
* Merge pull request #1886 from libgit2/precompose-utf8Vicent Martí2013-10-082-16/+17
|\ | | | | Add support for core.precomposeunicode on Mac
| * More filemode cleanups for FAT on MacOSRussell Belfer2013-10-082-17/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This cleans up some additional issues. The main change is that on a filesystem that doesn't support mode bits, libgit2 will now create new blobs with GIT_FILEMODE_BLOB always instead of being at the mercy to the filesystem driver to report executable or not. This means that if "core.filemode" lies and claims that filemode is not supported, then we will ignore the executable bit from the filesystem. Previously we would have allowed it. This adds an option to the new git_repository_reset_filesystem to recurse through submodules if desired. There may be other types of APIs that would like a "recurse submodules" option, but this one is particularly useful. This also has a number of cleanups, etc., for related things including trying to give better error messages when problems come up from the filesystem. For example, the FAT filesystem driver on MacOS appears to return errno EINVAL if you attempt to write a filename with invalid UTF-8 in it. We try to capture that with a better error message now.
| * Add git_repository_reset_filesystem and fix testsRussell Belfer2013-10-041-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a repository is transferred from one file system to another, many of the config settings that represent the properties of the file system may be wrong. This adds a new public API that will refresh the config settings of the repository to account for the change of file system. This doesn't do a full "reinitialize" and operates on a existing git_repository object refreshing the config when done. This commit then makes use of the new API in clar as each test repository is set up. This commit also has a number of other clar test fixes where we were making assumptions about the type of filesystem, either based on outdated config data or based on the OS instead of the FS.
* | index: Make _read() cope with index file creationnulltoken2013-10-041-0/+50
| |
* | Tabify indentationsnulltoken2013-10-041-8/+8
|/
* Fix incorrect return code in crlf filterRussell Belfer2013-09-241-5/+6
| | | | | | The git_buf_text_gather_stats call returns a boolean indicating if the file looks like binary data. That shouldn't be an error; it should be used to skip CRLF processing though.
* Add clar helper to create new commit from indexRussell Belfer2013-09-171-33/+2
| | | | | | | | There were a lot of places in the test code base that were creating a commit from the index on the current branch. This just adds a helper to handle that case pretty easily. There was only one test where this change ended up tweaking the test data, so pretty easy and mostly just a cleanup.
* Better macro name for is-exec-bit-set testRussell Belfer2013-09-051-1/+1
|
* Fix tests of file modesRussell Belfer2013-09-051-2/+5
| | | | | | | This fixes an issue checking file modes in the tests that initialize a repo from a template directory when a symlink is used in the template. Also, this updates some other places where we are examining file modes to use the new macros.
* index: report when it's lockedCarlos Martín Nieto2013-08-191-0/+25
| | | | | | | Report the index being locked with its own error code in order to be able to differentiate, as a locked index is typically the result of a crashed process or concurrent access, both of which often require user intervention to fix.
* Add tests and fix use of freed memoryRussell Belfer2013-06-191-0/+20
| | | | | | | | | | | This adds some tests for updating the index and having it remove items to make sure that the iteration over the index still works even as earlier items are removed. In testing with valgrind, this found a path that would use the path string from the index entry after it had been freed. The bug fix is simply to copy the path of the index entry before doing any actual index manipulation.
* Add index pathspec-based operationsRussell Belfer2013-06-191-0/+254
| | | | | | | | | | | | | This adds three new public APIs for manipulating the index: 1. `git_index_add_all` is similar to `git add -A` and will add files in the working directory that match a pathspec to the index while honoring ignores, etc. 2. `git_index_remove_all` removes files from the index that match a pathspec. 3. `git_index_update_all` updates entries in the index based on the current contents of the working directory, either added the new information or removing the entry from the index.
* Test has to work on case sensitive systemsRussell Belfer2013-06-171-3/+14
|
* some simple case-sensitive index testsEdward Thomson2013-06-171-0/+32
|
* introduce git_conflict_iteratorEdward Thomson2013-05-171-3/+48
|
* Fix trailing whitespacesnulltoken2013-05-152-28/+28
|
* move NAME and REUC extensions to sys/Edward Thomson2013-04-302-0/+2
|
* renames!Edward Thomson2013-04-301-0/+83
|
* Test fixes and cleanupRussell Belfer2013-03-251-8/+10
| | | | | | | | This fixes some places where the new tests were leaving the test area in a bad state or were freeing data they should not free. It also removes code that is extraneous to the core issue and fixes an invalid SHA being looked up in one of the tests (which was failing, but for the wrong reason).
* Added some tests for issue #1397Sven Strickroth2013-03-251-0/+40
| | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* Add cl_repo_set_bool and cleanup testsRussell Belfer2013-03-221-8/+2
| | | | | | This adds a helper function for the cases where you want to quickly set a single boolean config value for a repository. This allowed me to remove a lot of code.
* clear REUC on checkoutEdward Thomson2013-03-041-0/+85
|
* Vector improvements and their falloutPhilip Kelley2013-01-274-18/+18
|
* Use cl_assert_equal_s() instead of strcmp().Sebastian Bauer2013-01-252-13/+13
| | | | | Replaced all cl_assert(!strcmp()) or semantically equivalent forms by cl_assert_equal_s().
* add an index_remove_bypath that removes conflicts, renamed add_from_workdir ↵Edward Thomson2013-01-127-20/+39
| | | | to match
* REUC needs to handle empty sidesEdward Thomson2013-01-101-0/+50
|
* Add index API to remove all files in a directoryRussell Belfer2013-01-041-0/+83
| | | | This adds the git_index_remove_directory API plus tests.
* Proper cleanup jeezVicent Marti2013-01-031-43/+40
|
* Move test cleanup into cleanup functionsBen Straub2013-01-031-1/+5
|
* Tests should clean up after themselvesBen Straub2013-01-031-0/+1
|
* Fix warnings on Win64 buildRussell Belfer2012-11-274-7/+7
|
* API updates for index.hBen Straub2012-11-275-9/+9
|
* Reset all static variables to NULL in clar's __cleanupSascha Cunz2012-11-233-0/+6
| | | | | | | | | | | | Without this change, any failed assertion in the second (or a later) test inside a test suite has a chance of double deleting memory, resulting in a heap corruption. See #1096 for details. This leaves alone the test cases where we "just" use cl_git_sandbox_init() and cl_git_sandbox_cleanup(). These methods already take good care to not double delete a repository. Fixes #1096
* Add a test for invalid filenames while writing tree from indexfilename-validationScott J. Goldman2012-11-181-0/+27
|
* Merge pull request #1056 from nulltoken/duplicate-tree-entriesVicent Martí2012-11-101-0/+4
|\ | | | | Duplicate tree entries
| * index: Introduce git_index_has_conflicts()nulltoken2012-11-081-0/+4
| |
* | index: refine add_from_workdir() error reportnulltoken2012-11-102-0/+24
| |
* | index: make git_index_new() work with a NULL pathnulltoken2012-11-101-0/+11
|/
* index: Fix testsVicent Marti2012-11-011-2/+2
|
* index refactoringEdward Thomson2012-10-297-69/+534
|
* index: remove read_tree() progress indicatornulltoken2012-10-191-1/+1
| | | | | | | | git_index_read_tree() was exposing a parameter to provide the user with a progress indicator. Unfortunately, due to the recursive nature of the tree walk, the maximum number of items to process was unknown. Thus, the indicator was only counting processed entries, without providing any information how the number of remaining items.
* filemode: deploy enum usagenulltoken2012-08-211-20/+20
|
* Enable stats on git_index_read_tree.Ben Straub2012-07-301-1/+1
| | | | | Replace with the contents of git_index_read_tree_with_stats() and improve documentation comments.
* Make index add/append support core.filemode flagRussell Belfer2012-06-191-0/+212
| | | | | | | | | | | This fixes git_index_add and git_index_append to behave more like core git, preserving old filemode data in the index when adding and/or appending with core.filemode = false. This also has placeholder support for core.symlinks and core.ignorecase, but those flags are not implemented (well, symlinks has partial support for preserving mode information in the same way that git does, but it isn't tested).
* misc: Fix warnings from PVS Studio trialVicent Martí2012-06-071-1/+1
|