summaryrefslogtreecommitdiff
path: root/tests/index
Commit message (Collapse)AuthorAgeFilesLines
* index: user a better assertion when comparing sizesCarlos Martín Nieto2015-06-191-2/+2
| | | | | This will tell us which numbers we were trying to compare, rather than just telling us that they're different.
* Fixed build warnings on Xcode 6.1Pierre-Olivier Latour2015-06-021-3/+2
|
* git_index_add_all: test that conflicts are handledEdward Thomson2015-05-281-49/+104
| | | | | | When confronted with a conflict in the index, `git_index_add_all` should stage the working directory copy. If there is no file in the working directory, the conflict should simply be removed.
* introduce `git_index_entry_is_conflict`Edward Thomson2015-05-281-2/+2
| | | | | | | | | It's not always obvious the mapping between stage level and conflict-ness. More importantly, this can lead otherwise sane people to write constructs like `if (!git_index_entry_stage(entry))`, which (while technically correct) is unreadable. Provide a nice method to help avoid such messy thinking.
* conflict tests: use GIT_IDXENTRY_STAGE_SETEdward Thomson2015-05-282-15/+15
|
* index: validate mode of new conflictsEdward Thomson2015-05-281-1/+8
|
* conflicts: when adding conflicts, remove stagedEdward Thomson2015-05-281-0/+50
| | | | | | When adding a conflict for some path, remove the staged entry. Otherwise, an illegal index (with both stage 0 and high-stage entries) would result.
* index_add_all: include untracked files in new subdirsEdward Thomson2015-05-201-0/+23
|
* index: include TYPECHANGE in the diffCarlos Martín Nieto2015-05-141-0/+13
| | | | Without this option, we would not be able to catch exec bit changes.
* index: introduce git_index_read_indexEdward Thomson2015-05-111-0/+73
|
* Fix index-adding functions to know when to trust filemodes.John Fultz2015-04-211-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | The idea...sometimes, a filemode is user-specified via an explicit git_index_entry. In this case, believe the user, always. Sometimes, it is instead built up by statting the file system. In those cases, go with the existing logic we have to determine whether the file system supports all filemodes and symlinks, and make the best guess. On file systems which have full filemode and symlink support, this commit should make no difference. On others (most notably Windows), this will fix problems things like: * git_index_add and git_index_add_frombuffer() should be believed. * As a consequence, git_checkout_tree should make the filemodes in the index match the ones in the tree. * And diffs with GIT_DIFF_UPDATE_INDEX don't write the wrong filemodes. * And merges, and probably other downstream stuff now fixed, too. This makes my previous changes to checkout.c unnecessary, so they are now reverted. Also, added a test for index_entry permissions from git_index_add and git_index_add_frombuffer, both of which failed before these changes.
* Merge commit 'refs/pull/2879/head' of ssh://github.com/libgit2/libgit2Carlos Martín Nieto2015-03-111-0/+122
|\
| * Add API to add a memory buffer to an indexDamien PROFETA2015-02-251-0/+122
| | | | | | | | | | | | git_index_add_frombuffer enables now to store a memory buffer in the odb and to store an entry in the index directly if the index is attached to a repository.
* | reset: remove reflog message overrideCarlos Martín Nieto2015-03-032-6/+6
| | | | | | | | | | This function is meant to simulate what git does in the reset command, so we should include the reflog message in that.
* | Remove the signature from ref-modifying functionsCarlos Martín Nieto2015-03-032-6/+6
|/ | | | | | | | | | The signature for the reflog is not something which changes dynamically. Almost all uses will be NULL, since we want for the repository's default identity to be used, making it noise. In order to allow for changing the identity, we instead provide git_repository_set_ident() and git_repository_ident() which allow a user to override the choice of signature.
* git_indexwriter: lock then write the indexEdward Thomson2015-02-141-0/+21
| | | | | | Introduce `git_indexwriter`, to allow us to lock the index while performing additional operations, then complete the write (or abort, unlocking the index).
* index tests: test capitalization before mkdirhf/master_patchEdward Thomson2014-12-181-2/+4
|
* Plug leaksCarlos Martín Nieto2014-12-181-0/+2
|
* Create miscapitialised dirs for case-sensitive filesystemsCarlos Martín Nieto2014-12-181-0/+4
| | | | | We need these directories to exist so cl_git_mkfile() can create the files we ask it to.
* treebuilder: take a repository for path validationEdward Thomson2014-12-171-0/+21
| | | | | | Path validation may be influenced by `core.protectHFS` and `core.protectNTFS` configuration settings, thus treebuilders can take a repository to influence their configuration.
* index: Check for valid paths before creating an index entryVicent Marti2014-12-161-8/+93
|
* Spelling fixesWill Stamper2014-12-041-1/+1
|
* Clean up some memory leaksEdward Thomson2014-10-261-0/+2
|
* tree-cache: correct the entry_count calculationCarlos Martín Nieto2014-10-221-5/+5
| | | | | | | | | | | | | The entry_count field is the amount of index entries covered by a particular cache entry, that is how many files are there (recursively) under a particular directory. The current code that attemps to do this is severely defincient and is trying to count the amount of children, which always comes up to zero. We don't even need to recount, since we have the information during the cache creation. We can take that number and keep it, as we only ever invalidate or replace.
* index: make sure to write cached subtrees if parent is invalidatedCarlos Martín Nieto2014-10-101-0/+53
| | | | | If e.g. the root tree is invalidated, we still want to write out its children, since those may still have valid cache entries.
* index: write out the tree cache extensionCarlos Martín Nieto2014-10-101-6/+79
| | | | | | | | | | Keeping the cache around after read-tree is only one part of the optimisation opportunities. In order to share the cache between program instances, we need to write the TREE extension to the index. Do so, taking the opportunity to rename 'entries' to 'entry_count' to match the name given in the format description. The included test is rather trivial, but works as a sanity check.
* index: add tests for the tree cacheCarlos Martín Nieto2014-10-101-0/+110
| | | | | These test that we invalidate at the right levels and that we remove the tree cache when clearing the index.
* Allow to propagate checkout callbacks to git HARD resetSven Strickroth2014-08-032-6/+6
| | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* Introduce cl_assert_equal_oidEdward Thomson2014-07-016-53/+53
|
* Plug a leak in the testsCarlos Martín Nieto2014-06-031-0/+2
|
* index: check for valid filemodes on addcmn/index-add-modesCarlos Martín Nieto2014-05-221-0/+15
|
* Make core.safecrlf work on LF-ending platformsRussell Belfer2014-05-191-0/+18
| | | | | | If you enabled core.safecrlf on an LF-ending platform, we would error even for files with all LFs. We should only be warning on irreversible mappings, I think.
* Some vector utility tweaksRussell Belfer2014-04-171-17/+3
| | | | | This is just laying some groundwork for internal index changes that I'm working on.
* git_checkout_opts -> git_checkout_optionsBen Straub2014-03-062-6/+6
|
* Staticize file-local variablesBen Straub2014-02-241-1/+1
|
* Tests for crlf filtering into the repositoryEdward Thomson2014-02-091-0/+136
|
* Merge pull request #2099 from libgit2/bs/more-reflog-stuffRussell Belfer2014-02-072-11/+11
|\ | | | | More reflogness
| * Add reflog parameters to git_resetBen Straub2014-02-032-6/+6
| |
| * Reset helpers: use revparse insteadBen Straub2014-02-032-5/+5
| |
* | Fix typo setting sorted flag when reloading indexRussell Belfer2014-02-041-0/+34
| | | | | | | | | | | | | | This fixes a typo I made for setting the sorted flag on the index after a reload. That typo didn't actually cause any test failures so I'm also adding a test that explicitly checks that the index is correctly sorted after a reload when ignoring case and when not.
* | Convert pqueue to just be a git_vectorRussell Belfer2014-02-041-4/+4
|/ | | | | | | | | | | | | This updates the git_pqueue to simply be a set of specialized init/insert/pop functions on a git_vector. To preserve the pqueue feature of having a fixed size heap, I converted the "sorted" field in git_vectors to a more general "flags" field so that pqueue could mix in it's own flag. This had a bunch of ramifications because a number of places were directly looking at the vector "sorted" field - I added a couple new git_vector helpers (is_sorted, set_sorted) so the specific representation of this information could be abstracted.
* More index collision testsEdward Thomson2014-01-291-0/+64
|
* Add test for blob/tree name collisions in indexRussell Belfer2014-01-291-0/+42
|
* index: rename an entry's id to 'id'Carlos Martín Nieto2014-01-253-26/+26
| | | | This was not converted when we converted the rest, so do it now.
* More improvements to callback return value testsRussell Belfer2013-12-111-30/+128
| | | | | | This time actually checking return values in diff notify tests and actually testing callbacks for the index all-all/update-all/etc functions.
* tests: Drop unrelated commentnulltoken2013-11-191-1/+0
|
* tree-cache: Don't segfault upon corruptionnulltoken2013-11-191-0/+9
|
* Rename tests-clar to testsBen Straub2013-11-1410-0/+1936