summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* repository: distinguish sequencer cherry-pick and revertcmn/repository-state-sequencerCarlos Martín Nieto2015-11-201-0/+18
| | | | These are not quite like their plain counterparts and require special handling.
* Merge pull request #3511 from ethomson/racy_fixes_2Carlos Martín Nieto2015-11-172-10/+192
|\ | | | | Racy fixes for writing new indexes
| * racy: make git_index_read_index handle racinessEdward Thomson2015-11-161-0/+48
| | | | | | | | | | | | | | | | | | | | | | Ensure that `git_index_read_index` clears the uptodate bit on files that it modifies. Further, do not propagate the cache from an on-disk index into another on-disk index. Although this should not be done, as `git_index_read_index` is used to bring an in-memory index into another index (that may or may not be on-disk), ensure that we do not accidentally bring in these bits when misused.
| * racy: ensure git_index_read_tree clears uptodateEdward Thomson2015-11-161-0/+28
| | | | | | | | | | Ensure that `git_index_read_tree` clears the uptodate bit on files that it modifies.
| * index: test for smudged entries on write onlyEdward Thomson2015-11-161-7/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test that entries are only smudged when we write the index: the entry smudging is to prevent us from updating an index in a way that it would be impossible to tell that an item was racy. Consider when we load an index: any entries that have the same (or newer) timestamp than the index itself are considered racy, and are subject to further scrutiny. If we *save* that index with the same entries that we loaded, then the index would now have a newer timestamp than the entries, and they would no longer be given that additional scrutiny, failing our racy detection! So test that we smudge those entries only on writing the new index, but that we can detect them (in diff) without having to write.
| * checkout::crlf test: don't crash when no idx entryEdward Thomson2015-11-161-4/+5
| | | | | | | | | | | | | | | | | | | | When there's no matching index entry (for whatever reason), don't try to dereference the null return value to get at the id. Otherwise when we break something in the index API, the checkout test crashes for confusing reasons and causes us to step through it in a debugger thinking that we had broken much more than we actually did.
| * index: don't detect raciness in uptodate entriesEdward Thomson2015-11-161-0/+77
| | | | | | | | | | | | | | | | | | | | | | Keep track of entries that we believe are up-to-date, because we added the index entries since the index was loaded. This prevents us from unnecessarily examining files that we wrote during the cleanup of racy entries (when we smudge racily clean files that have a timestamp newer than or equal to the index's timestamp when we read it). Without keeping track of this, we would examine every file that we just checked out for raciness, since all their timestamps would be newer than the index's timestamp.
* | tests: use out-of-the-way config dir in sandboxEdward Thomson2015-11-171-5/+12
| | | | | | | | | | | | Don't put the configuration in a subdir of the sandbox named `config`, lest some tests decide to create their own directory called `config`. Prefix with some underscores for uniqueness.
* | tests: set PROGRAMDATA directory for running testsEdward Thomson2015-11-171-0/+2
| |
* | config::global: use PROGRAMDATA configurationEdward Thomson2015-11-171-4/+6
|/ | | | | Query the `GIT_CONFIG_LEVEL_PROGRAMDATA` location when setting it up for tests, in case the test runner has sandboxed it.
* pool: Never return unaligned buffersvmg/pool-alignVicent Marti2015-11-131-2/+2
|
* Merge pull request #3170 from CmdrMoozy/nsec_fixCarlos Martín Nieto2015-11-124-14/+25
|\ | | | | git_index_entry__init_from_stat: set nsec fields in entry stats
| * Merge branch 'master' into nsec_fix_nextAxel Rasmussen2015-10-0135-24/+222
| |\
| * | diff/index: respect USE_NSEC for racily clean file detectionAxel Rasmussen2015-09-182-13/+13
| | |
| * | cmake: Only provide USE_NSEC if struct stat members are avilable.Axel Rasmussen2015-09-181-2/+1
| | | | | | | | | | | | | | | | | | This allows us to remove OS checks from source code, instead relying on CMake to detect whether or not `struct stat` has the nanoseconds members we rely on.
| * | caps: add test for GIT_FEATURES_NSECAxel Rasmussen2015-09-181-0/+6
| | |
| * | cmake: add USE_NSEC, and only check nanosec m/ctime if enabledAxel Rasmussen2015-09-181-1/+7
| | |
* | | Merge pull request #3499 from ethomson/ref_dir_errmsgsCarlos Martín Nieto2015-11-123-0/+97
|\ \ \ | | | | | | | | Improve error messages when dirs prevent ref/reflog creation
| * | | reflog: error when a directory is at reflog pathEdward Thomson2015-11-121-0/+53
| | | | | | | | | | | | | | | | | | | | When a non-empty directory exists and prevents the creation of a reflog, provide a more informative error message.
| * | | refs: complain when a directory exists at refEdward Thomson2015-11-121-0/+17
| | | | | | | | | | | | | | | | | | | | When a (non-empty) directory exists at the reference target location, complain with a more actionable error message.
| * | | filebuf: detect directories in our wayEdward Thomson2015-11-031-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | When creating a filebuf, detect a directory that exists in our target file location. This prevents a failure later, when we try to move the lock file to the destination.
| * | | reflog: test reflog is deleted when ref is deletedEdward Thomson2015-11-031-0/+18
| | | |
* | | | Merge pull request #3448 from libgit2/cmn/custom-agentCarlos Martín Nieto2015-11-121-0/+11
|\ \ \ \ | | | | | | | | | | Support setting custom user-agent
| * | | | settings: add a setter for a custom user-agentCarlos Martín Nieto2015-11-121-0/+11
| | | | |
* | | | | Failing test for case sensitive conflicts in the indexnulltoken2015-11-121-0/+91
|/ / / /
* | | | Merge pull request #3498 from ethomson/windows_symlinksCarlos Martín Nieto2015-11-082-0/+90
|\ \ \ \ | | | | | | | | | | Diff: Honor `core.symlinks=false` and fake symlinks
| * | | | index: test that add_bypath preserves symlinksEdward Thomson2015-11-031-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test that on platforms without `core.symlinks`, we preserve symlinks in `git_index_add_bypath`. (Users should correct the actual index entry's mode to change a link to a regular file.)
| * | | | diff: test "symlinks" in wd are respected on win32Edward Thomson2015-11-031-0/+61
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `core.symlinks = false`, we write the symlinks content (target) to a regular file. We should ensure that when we later see that regular file, we treat it specially - and that changing that regular file would actually change the symlink target. (For compatibility with Git for Windows).
* | | | Merge pull request #3500 from ethomson/submodules_with_pathCarlos Martín Nieto2015-11-0815-0/+77
|\ \ \ \ | | | | | | | | | | Handle submodules with paths in `git_submodule_update`
| * | | | submodule: test updating a submodule w/ a pathEdward Thomson2015-11-0415-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | | Test that `git_submodule_update` can handle a submodule that is freshly cloned and has a path differing from its name.
* | | | | Merge pull request #3465 from libgit2/cmn/tls-registerEdward Thomson2015-11-041-0/+47
|\ \ \ \ \ | |/ / / / |/| | | | stream: allow registering a user-provided TLS constructor
| * | | | stream: allow registering a user-provided TLS constructorcmn/tls-registerCarlos Martín Nieto2015-11-031-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | This allows the application to use their own TLS stream, regardless of the capabilities of libgit2 itself.
* | | | | Fix git_commit_summary to convert newlines to spaces even afterStjepan Rajko2015-11-032-3/+7
| | | | | | | | | | | | | | | | | | | | whitespace. Collapse spaces around newlines for the summary.
* | | | | Merge pull request #3494 from leoyanggit/fix_unit_test_buildCarlos Martín Nieto2015-11-031-2/+13
|\ \ \ \ \ | |/ / / / |/| | | | Fix build for unit test
| * | | | Fix build for unit testLeo Yang2015-11-021-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | If none of GIT_OPENSSL, GIT_WINHTTP or GIT_SECURE_TRANSPORT is defined we should also be able to build the unit test.
* | | | | Add diff progress callback.Jason Haslam2015-11-022-2/+29
| |/ / / |/| | |
* | | | Merge pull request #3491 from libgit2/cmn/config-checksumEdward Thomson2015-11-021-0/+20
|\ \ \ \ | | | | | | | | | | Use checksums to detect config file changes
| * | | | config: add failing test for an external modificationCarlos Martín Nieto2015-10-301-0/+20
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently use the timestamp in order to decide whether a config file has changed since we last read it. This scheme falls down if the file is written twice within the same second, as we fail to detect the file change after the first read in that second.
* | | | merge: Fix memory leak in testvmg/redundantVicent Marti2015-11-021-0/+1
| | | |
* | | | Add test caseVicent Marti2015-11-028-0/+30
|/ / /
* | | Merge pull request #3486 from srajko/reflog-segfault-fixCarlos Martín Nieto2015-10-291-0/+43
|\ \ \ | | | | | | | | Fix segfault when reading reflog with extra newlines
| * | | Prevent segfault when parsing a reflog with oid parse errorStjepan Rajko2015-10-291-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | Using calloc instead of malloc because the parse error will lead to an immediate free of committer (and its properties, which can segfault on free if undefined - test_refs_reflog_reflog__reading_a_reflog_with_invalid_format_returns_error segfaulted before the fix). #3458
* | | | pool: Handle 32 bit systemsVicent Marti2015-10-281-1/+1
| | | |
* | | | pool: Simplify implementationVicent Marti2015-10-281-71/+11
|/ / /
* | | merge: add GIT_MERGE_TREE_FAIL_ON_CONFLICTEdward Thomson2015-10-222-5/+22
| | | | | | | | | | | | | | | | | | Provide a new merge option, GIT_MERGE_TREE_FAIL_ON_CONFLICT, which will stop on the first conflict and fail the merge operation with GIT_EMERGECONFLICT.
* | | Merge pull request #3480 from ethomson/nsecsCarlos Martín Nieto2015-10-2213-0/+93
|\ \ \ | | | | | | | | Nanoseconds in the index: ignore for diffing
| * | | index: test that we round-trip nsecsEdward Thomson2015-10-2213-0/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Test that nanoseconds are round-tripped correctly when we read an index file that contains them. We should, however, ignore them because we don't understand them, and any new entries in the index should contain a `0` nsecs field, while existing preserving entries.
* | | | Merge pull request #3475 from libgit2/cmn/programdata-configEdward Thomson2015-10-211-0/+40
|\ \ \ \ | |/ / / |/| | | config: add a ProgramData level
| * | | config: add a ProgramData levelcmn/programdata-configCarlos Martín Nieto2015-10-211-0/+40
| | | | | | | | | | | | | | | | | | | | This is where portable git stores the global configuration which we can use to adhere to it even though git isn't quite installed on the system.
* | | | tests: Fix warningsvmg/crudVicent Marti2015-10-212-2/+3
| | | |