summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* commit: allow retrieving an arbitrary header fieldcmn/commit-header-fieldCarlos Martín Nieto2015-06-221-0/+38
| | | | | | This allows the user to look up fields which we don't parse in libgit2, and allows them to access gpgsig or mergetag fields if they wish to check the signature.
* status: test that symlinks don't lose their modeEdward Thomson2015-06-201-0/+48
| | | | | | Test to ensure that when status updates an index, it does not alter the original mode for file types that are not supported (eg, symlinks on Windows).
* Merge pull request #3238 from git-up/double_freeEdward Thomson2015-06-201-2/+0
|\ | | | | Fixed index being double-freed in stash tests
| * Fixed index being double-freed in stash testsPierre-Olivier Latour2015-06-201-2/+0
| |
* | Merge pull request #3236 from libgit2/cmn/index-checksumEdward Thomson2015-06-201-2/+2
|\ \ | |/ |/| Use the checksum to check whether an index has been modified
| * 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.
* | tests: tick over five seconds instead of oneCarlos Martín Nieto2015-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | When ticking over one second, it can happen that the actual time ticks over the same second between the time that we undermine our own race protections and the time in which we perform the index update. Such timing would make the time in the entries match the index' timestamp and we have not gained anything. Ticking over five seconds makes it so that if real-time rolls over that second, our index is still ahead. This is still suboptimal as we're dealing with timing, but five seconds should be long enough for any reasonable test runner to finish the tests.
* | Fixed Xcode 6.1 build warningsPierre-Olivier Latour2015-06-171-1/+0
| |
* | Fix memory leak in tests/network/refspecs.cJeff Hostetler2015-06-171-0/+2
|/
* Merge pull request #3219 from libgit2/cmn/racy-diffCarlos Martín Nieto2015-06-178-4/+143
|\ | | | | Zero out racily-clean entries' file_size
| * merge::workdir::dirty: tick idx to defeat racy-gitEdward Thomson2015-06-161-0/+12
| |
| * Introduce p_utimes and p_futimesEdward Thomson2015-06-162-5/+56
| | | | | | | | | | | | Provide functionality to set the time on a filesystem entry, using utimes or futimes on POSIX type systems or SetFileTime on Win32.
| * tests: tick the index when we count OID calculationsCarlos Martín Nieto2015-06-165-19/+34
| | | | | | | | | | | | | | | | | | These tests want to test that we don't recalculate entries which match the index already. This is however something we force when truncating racily-clean entries. Tick the index forward as we know that we don't perform the modifications which the racily-clean code is trying to avoid.
| * crlf: tick the index forward to work around racy-git behaviourCarlos Martín Nieto2015-06-161-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | In order to avoid racy-git, we zero out the file size for entries with the same timestamp as the index (or during the initial checkout). This is the case in a couple of crlf tests, as the code is fast enough to do everything in the same second. As we know that we do not perform the modification just after writing out the index, which is what this is designed to work around, tick the mtime of the index file such that it doesn't agree with the files anymore, and we do not zero out these entries.
| * diff: add failing test for racy-git in the indexCarlos Martín Nieto2015-06-161-0/+39
| | | | | | | | | | | | | | | | | | | | | | We update the index and then immediately change the contents of the file. This makes the diff think there are no changes, as the timestamp of the file agrees with the cached data. This is however a bug, as the file has obviously changed contents. The test is a bit fragile, as it assumes that the index writing and the following modification of the file happen in the same second, but it's enough to show the issue.
* | Merge pull request #3209 from libgit2/cmn/double-authorEdward Thomson2015-06-161-0/+7
|\ \ | | | | | | commit: ignore multiple author fields
| * | commit: ignore multiple author fieldscmn/double-authorCarlos Martín Nieto2015-06-111-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some tools create multiple author fields. git is rather lax when parsing them, although fsck does complain about them. This means that they exist in the wild. As it's not too taxing to check for them, and there shouldn't be a noticeable slowdown when dealing with correct commits, add logic to skip over these extra fields when parsing the commit.
* | | Fixed Xcode 6.1 build warningsPierre-Olivier Latour2015-06-153-12/+20
| |/ |/|
* | Merge pull request #3177 from ethomson/binary_diffCarlos Martín Nieto2015-06-1511-167/+415
|\ \ | | | | | | Binary diffs: store deltas in the diff structure, include binary data in diff callbacks
| * | binary diff: test binary blob to blob testsEdward Thomson2015-06-121-0/+130
| | |
| * | diff: introduce binary diff callbacksEdward Thomson2015-06-1210-167/+186
| | | | | | | | | | | | | | | | | | | | | Introduce a new binary diff callback to provide the actual binary delta contents to callers. Create this data from the diff contents (instead of directly from the ODB) to support binary diffs including the workdir, not just things coming out of the ODB.
| * | binary diff: test index->workdir binary diffsEdward Thomson2015-06-121-0/+99
| | |
* | | Merge pull request #3217 from jeffhostetler/leak_checkout_icaseCarlos Martín Nieto2015-06-151-0/+2
|\ \ \ | |/ / |/| | Fix leaks in tests/checkout/icase
| * | Fix leaks in tests/checkout/icaseJeff Hostetler2015-06-121-0/+2
| | |
* | | clone: set the credentials callback during testingcmn/push-testsCarlos Martín Nieto2015-06-121-0/+1
| | |
* | | push: pass the callbacks during setup as wellCarlos Martín Nieto2015-06-121-3/+7
| |/ |/| | | | | | | We need to pass these options in order to have the credentials callback set.
* | Introduce `git_filter_list_contains`Edward Thomson2015-06-101-0/+91
|/ | | | | `git_filter_list_contains` can be used to query a filter list to determine if a given filter will be run.
* Merge pull request #3165 from ethomson/downcaseCarlos Martín Nieto2015-06-081-0/+42
|\ | | | | Downcase
| * git__tolower: test that some non-ASCII downcasing isn'tEdward Thomson2015-05-291-0/+4
| |
| * git__strcasecmp: treat input bytes as unsignedEdward Thomson2015-05-291-0/+38
| | | | | | | | | | | | Treat input bytes as unsigned before doing arithmetic on them, lest we look at some non-ASCII byte (like a UTF-8 character) as a negative value and perform the comparison incorrectly.
* | Merge pull request #3185 from libgit2/cmn/foreach-cancel-looseCarlos Martín Nieto2015-06-071-0/+20
|\ \ | | | | | | path: error out if the callback returns an error
| * | path: error out if the callback returns an errorcmn/foreach-cancel-looseCarlos Martín Nieto2015-06-061-0/+20
| | | | | | | | | | | | | | | | | | | | | When the callback returns an error, we should stop immediately. This broke when trying to make sure we pass specific errors up the chain. This broke cancelling out of the loose backend's foreach.
* | | Fixed build warnings on Xcode 6.1Pierre-Olivier Latour2015-06-026-9/+14
|/ /
* | remote: test insteadOf for anonymous remotesPatrick Steinhardt2015-05-311-0/+12
| |
* | remote: apply insteadOf configuration.Patrick Steinhardt2015-05-312-0/+72
| | | | | | | | | | | | | | | | A remote's URLs are now modified according to the url.*.insteadOf and url.*.pushInsteadOf configurations. This allows a user to replace URL prefixes by setting the corresponding keys. E.g. "url.foo.insteadOf = bar" would replace the prefix "bar" with the new prefix "foo".
* | Merge pull request #3157 from mgorny/ssh_memory_authCarlos Martín Nieto2015-05-291-0/+68
|\ \ | | | | | | Support getting SSH keys from memory, pt. 2
| * | test: Add a test for in-memory SSH private key cred_cbMichał Górny2015-05-271-0/+68
| | |
* | | Rename GIT_EMERGECONFLICT to GIT_ECONFLICTEdward Thomson2015-05-292-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We do not error on "merge conflicts"; on the contrary, merge conflicts are a normal part of merging. We only error on "checkout conflicts", where a change exists in the index or the working directory that would otherwise be overwritten by performing the checkout. This *may* happen during merge (after the production of the new index that we're going to checkout) but it could happen during any checkout.
* | | Merge pull request #3139 from ethomson/diff_conflictsCarlos Martín Nieto2015-05-2817-80/+374
|\ \ \ | | | | | | | | Include conflicts when diffing
| * | | 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 cl_git_sandbox_init_new()Edward Thomson2015-05-282-0/+9
| | | | | | | | | | | | | | | | | | | | cl_git_sandbox_init_new() will create a clar temp directory and initialize a new repository at that location.
| * | | introduce `git_index_entry_is_conflict`Edward Thomson2015-05-283-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-287-26/+26
| | | |
| * | | diff conflicts: don't include incorrect IDEdward Thomson2015-05-281-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since a diff entry only concerns a single entry, zero the information for the index side of a conflict. (The index entry would otherwise erroneously include the lowest-stage index entry - generally the ancestor of a conflict.) Test that during status, the index side of the conflict is empty.
| * | | diff conflicts: test index to workdir w/ conflictsEdward Thomson2015-05-281-0/+45
| | | |
| * | | diff conflicts: add tests for tree to indexEdward Thomson2015-05-283-2/+78
| | | |
| * | | diff/status: introduce conflictsEdward Thomson2015-05-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When diffing against an index, return a new `GIT_DELTA_CONFLICTED` delta type for items that are conflicted. For a single file path, only one delta will be produced (despite the fact that there are multiple entries in the index). Index iterators now have the (optional) ability to return conflicts in the index. Prior to this change, they would be omitted, and callers (like diff) would omit conflicted index entries entirely.
| * | | index: validate mode of new conflictsEdward Thomson2015-05-282-1/+14
| | | |
| * | | conflicts: when adding conflicts, remove stagedEdward Thomson2015-05-282-1/+51
| | |/ | |/| | | | | | | | | | | | | 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.
* | | Merge pull request #3149 from libgit2/cmn/upstream-matching-pushEdward Thomson2015-05-282-0/+42
|\ \ \ | | | | | | | | Fill the pointers for matching refspecs