summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* repository: distinguish sequencer cherry-pick and revertcmn/repository-state-sequencerCarlos Martín Nieto2015-11-204-3/+35
| | | | 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-173-53/+286
|\ | | | | Racy fixes for writing new indexes
| * racy: make git_index_read_index handle racinessEdward Thomson2015-11-162-30/+96
| | | | | | | | | | | | | | | | | | | | | | 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: clear uptodate bit on saveEdward Thomson2015-11-161-1/+16
| | | | | | | | | | | | The uptodate bit should have a lifecycle of a single read->write on the index. Once the index is written, the files within it should be scanned for racy timestamps against the new index timestamp.
| * 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-162-2/+84
| | | | | | | | | | | | | | | | | | | | | | 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.
| * racy-git: do a single index->workdir diffEdward Thomson2015-11-161-10/+23
| | | | | | | | | | | | When examining paths that are racily clean, do a single index->workdir diff over the entirety of the racily clean files, instead of a diff per file.
* | Merge pull request #3512 from ethomson/windows_sysdirCarlos Martín Nieto2015-11-174-16/+37
|\ \ | |/ |/| Protect windows SYSDIR when running tests
| * 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.
| * settings: allow users to set PROGRAMDATAEdward Thomson2015-11-162-8/+18
|/ | | | | | Allow users to set the `git_libgit2_opts` search path for the `GIT_CONFIG_LEVEL_PROGRAMDATA`. Convert `GIT_CONFIG_LEVEL_PROGRAMDATA` to `GIT_SYSDIR_PROGRAMDATA` for setting the configuration.
* Merge pull request #3506 from libgit2/vmg/pool-alignCarlos Martín Nieto2015-11-132-10/+18
|\ | | | | pool: Never return unaligned buffers
| * pool: Never return unaligned buffersvmg/pool-alignVicent Marti2015-11-132-10/+18
|/
* Merge pull request #3170 from CmdrMoozy/nsec_fixCarlos Martín Nieto2015-11-1216-50/+175
|\ | | | | git_index_entry__init_from_stat: set nsec fields in entry stats
| * diff: refactor complex timestamp check into its own functionAxel Rasmussen2015-10-011-5/+27
| |
| * index: don't populate nsec values if GIT_USE_NSEC is offAxel Rasmussen2015-10-011-0/+3
| |
| * Merge branch 'master' into nsec_fix_nextAxel Rasmussen2015-10-0157-84/+488
| |\
| * | apple: work around non-POSIX struct stat on OS X.Axel Rasmussen2015-09-181-6/+17
| | |
| * | diff/index: respect USE_NSEC for racily clean file detectionAxel Rasmussen2015-09-186-26/+43
| | |
| * | win32: define our own POSIX struct stat, and support USE_NSECAxel Rasmussen2015-09-186-18/+58
| | |
| * | cmake: fix CMake code organization problemAxel Rasmussen2015-09-181-6/+6
| | |
| * | cmake: Only provide USE_NSEC if struct stat members are avilable.Axel Rasmussen2015-09-183-5/+9
| | | | | | | | | | | | | | | | | | 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
| | |
| * | settings: expose GIT_USE_NSEC flag in git_libgit2_featuresAxel Rasmussen2015-09-182-2/+6
| | |
| * | cmake: add USE_NSEC, and only check nanosec m/ctime if enabledAxel Rasmussen2015-09-184-3/+21
| | |
* | | Merge pull request #3499 from ethomson/ref_dir_errmsgsCarlos Martín Nieto2015-11-125-5/+118
|\ \ \ | | | | | | | | Improve error messages when dirs prevent ref/reflog creation
| * | | reflog: error when a directory is at reflog pathEdward Thomson2015-11-122-4/+64
| | | | | | | | | | | | | | | | | | | | 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-122-1/+21
| | | | | | | | | | | | | | | | | | | | 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-032-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | 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-128-3/+86
|\ \ \ \ | | | | | | | | | | Support setting custom user-agent
| * | | | CHANGELOG: add note about custom user-agentCarlos Martín Nieto2015-11-121-0/+3
| | | | |
| * | | | winhttp: use a custom user-agent if the user has set itCarlos Martín Nieto2015-11-121-2/+34
| | | | | | | | | | | | | | | | | | | | | | | | | We also keep the "git/1.0" prefix in order to maintain compatibility with hosters.
| * | | | http: use a custom user-agent if the user has set itCarlos Martín Nieto2015-11-121-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | We still prefix it with "git/1.0" since that's required in many situations, but we replace the area which mentions libgit2.
| * | | | settings: add a setter for a custom user-agentCarlos Martín Nieto2015-11-125-0/+37
| | | | |
* | | | | Merge pull request #2534 from libgit2/ntk/case_index_conflictsEdward Thomson2015-11-123-6/+98
|\ \ \ \ \ | |/ / / / |/| | | | Failing test for case sensitive conflicts in the index
| * | | | index: overwrite the path when inserting conflictsntk/case_index_conflictsCarlos Martín Nieto2015-11-122-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we insert a conflict in a case-insensitive index, accept the new entry's path as the correct case instead of leaving the path we already had. This puts `git_index_conflict_add()` on the same level as `git_index_add()` in this respect.
| * | | | index: correctly report which conflict stage has a wrong filemodeCarlos Martín Nieto2015-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | When we're at offset 'i', we're dealing with the 'i+1' stage, since conflicts start at 1.
| * | | | 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-083-0/+115
|\ \ \ \ | | | | | | | | | | 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: on win32, treat fake "symlinks" speciallyEdward Thomson2015-11-031-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On platforms that lack `core.symlinks`, we should not go looking for symbolic links and `p_readlink` their target. Instead, we should examine the file's contents.
| * | | | 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-0816-24/+95
|\ \ \ \ | | | | | | | | | | Handle submodules with paths in `git_submodule_update`
| * | | | submodule: reload HEAD/index after reading configEdward Thomson2015-11-041-24/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reload the HEAD and index data for a submodule after reading the configuration. The configuration may specify a `path`, so we must update HEAD and index data with that path in mind.
| * | | | 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-045-0/+81
|\ \ \ \ \ | |/ / / / |/| | | | stream: allow registering a user-provided TLS constructor