summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* index: overwrite the path when inserting conflictsntk/case_index_conflictsCarlos Martín Nieto2015-11-121-1/+1
| | | | | | | | | 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.
* Merge pull request #3498 from ethomson/windows_symlinksCarlos Martín Nieto2015-11-081-0/+25
|\ | | | | Diff: Honor `core.symlinks=false` and fake symlinks
| * 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.
* | Merge pull request #3500 from ethomson/submodules_with_pathCarlos Martín Nieto2015-11-081-24/+18
|\ \ | | | | | | 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.
* | | Merge pull request #3465 from libgit2/cmn/tls-registerEdward Thomson2015-11-042-0/+16
|\ \ \ | |/ / |/| | stream: allow registering a user-provided TLS constructor
| * | stream: allow registering a user-provided TLS constructorcmn/tls-registerCarlos Martín Nieto2015-11-031-0/+13
| | | | | | | | | | | | | | | This allows the application to use their own TLS stream, regardless of the capabilities of libgit2 itself.
| * | stream: accept NULL in the free functionCarlos Martín Nieto2015-11-031-0/+3
| | |
* | | Fix git_commit_summary to convert newlines to spaces even afterStjepan Rajko2015-11-031-10/+25
|/ / | | | | | | whitespace. Collapse spaces around newlines for the summary.
* | Add diff progress callback.Jason Haslam2015-11-021-2/+13
|/
* Merge pull request #3491 from libgit2/cmn/config-checksumEdward Thomson2015-11-023-36/+39
|\ | | | | Use checksums to detect config file changes
| * filebuf: use an internal buffercmn/config-checksumCarlos Martín Nieto2015-10-301-6/+10
| | | | | | | | | | | | This reduces the chances of a crash in the thread tests. This shouldn't affect general usage too much, since the main usage of these functions are to read into an empty buffer.
| * filebuf: use a checksum to detect file changesCarlos Martín Nieto2015-10-303-34/+33
| | | | | | | | | | | | Instead of relying on the size and timestamp, which can hide changes performed in the same second, hash the file content's when we care about detecting changes.
* | merge-base: StyleVicent Marti2015-11-021-1/+6
| |
* | merge-base: Do not read parents from the rootVicent Marti2015-11-021-1/+1
| |
* | merge-base: Remove redundant merge basesVicent Marti2015-11-022-22/+166
|/
* Merge pull request #3493 from ethomson/read_indexCarlos Martín Nieto2015-10-301-9/+29
|\ | | | | index: read_index must update hashes
| * index: read_index must update hashesEdward Thomson2015-10-301-9/+29
| |
* | git: put NULL check at the topCarlos Martín Nieto2015-10-301-2/+5
|/
* git: accept NULL as argument to its stream freeCarlos Martín Nieto2015-10-301-2/+2
|
* Merge pull request #3486 from srajko/reflog-segfault-fixCarlos Martín Nieto2015-10-291-1/+1
|\ | | | | Fix segfault when reading reflog with extra newlines
| * Prevent segfault when parsing a reflog with oid parse errorStjepan Rajko2015-10-291-1/+1
| | | | | | | | | | | | 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: fix documentationEdward Thomson2015-10-281-2/+2
| |
* | merge: Do not mallocz unecessary entriesvmg/poolVicent Marti2015-10-281-2/+2
| |
* | pool: update commentVicent Marti2015-10-281-1/+1
| |
* | pool: Dot not assume mallocs are zeroed outVicent Marti2015-10-284-24/+23
| |
* | pool: Take into account malloc overhead & pool page sizeVicent Marti2015-10-281-1/+2
| |
* | repository: plug memory leakVicent Marti2015-10-281-0/+1
| | | | | | | | cc @carlosmn
* | pool: Simplify implementationVicent Marti2015-10-2816-265/+72
| |
* | merge: Plug memory leakvmg/reuc-insertVicent Marti2015-10-271-3/+3
| |
* | merge: Implement `GIT_MERGE_TREE_SKIP_REUC`Vicent Marti2015-10-271-28/+43
| |
* | reuc: Be smarter when inserting new REUC entriesVicent Marti2015-10-271-19/+16
|/ | | | | | | | | | Inserting new REUC entries can quickly become pathological given that each insert unsorts the REUC vector, and both subsequent lookups *and* insertions will require sorting it again before being successful. To avoid this, we're switching to `git_vector_insert_sorted`: this keeps the REUC vector constantly sorted and lets us use the `on_dup` callback to skip an extra binary search on each insertion.
* Merge pull request #3481 from ethomson/xdiff_includeCarlos Martín Nieto2015-10-231-1/+1
|\ | | | | xdiff: reference util.h in parent directory
| * xdiff: reference util.h in parent directoryEdward Thomson2015-10-221-1/+1
| | | | | | | | | | | | Although CMake will correctly configure include directories for us, some people may use their own build system, and we should reference `util.h` based on where it actually lives.
* | merge: add GIT_MERGE_TREE_FAIL_ON_CONFLICTEdward Thomson2015-10-221-1/+8
| | | | | | | | | | | | 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-221-1/+3
|\ \ | | | | | | Nanoseconds in the index: ignore for diffing
| * | diff: ignore nsecs when diffingEdward Thomson2015-10-221-1/+3
| |/ | | | | | | | | | | | | | | | | Although our index contains the literal time present in the index, we do not read nanoseconds from disk, and thus we should not use them in any comparisons, lest we always think our working directory is dirty. Guard this behind a `GIT_USE_NSECS` for future improvement.
* | Merge pull request #3475 from libgit2/cmn/programdata-configEdward Thomson2015-10-217-5/+64
|\ \ | |/ |/| config: add a ProgramData level
| * config: add a ProgramData levelcmn/programdata-configCarlos Martín Nieto2015-10-217-5/+64
| | | | | | | | | | 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.
* | index: Remove unneeded constsVicent Marti2015-10-211-3/+3
| |
* | signature: Strip crud just like Git doesVicent Marti2015-10-211-2/+16
|/
* Merge pull request #3466 from libgit2/cmn/quick-parse-64Edward Thomson2015-10-152-4/+4
|\ | | | | revwalk: make commit list use 64 bits for time
| * revwalk: make commit list use 64 bits for timecmn/quick-parse-64Carlos Martín Nieto2015-10-142-4/+4
| | | | | | | | | | | | | | | | We moved the "main" parsing to use 64 bits for the timestamp, but the quick parsing for the revwalk did not. This means that for large timestamps we fail to parse the time and thus the walk. Move this parser to use 64 bits as well.
* | Merge pull request #3444 from ethomson/add_preserves_conflict_modeCarlos Martín Nieto2015-10-151-15/+62
|\ \ | | | | | | Preserve modes from a conflict in `git_index_insert`
| * | index: also try conflict mode when insertingEdward Thomson2015-09-301-15/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we do not trust the on-disk mode, we use the mode of an existing index entry. This allows us to preserve executable bits on platforms that do not honor them on the filesystem. If there is no stage 0 index entry, also look at conflicts to attempt to answer this question: prefer the data from the 'ours' side, then the 'theirs' side before falling back to the common ancestor.
* | | odb: Prioritize alternate backendsvmg/odb-lookupsVicent Marti2015-10-141-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For most real use cases, repositories with alternates use them as main object storage. Checking the alternate for objects before the main repository should result in measurable speedups. Because of this, we're changing the sorting algorithm to prioritize alternates *in cases where two backends have the same priority*. This means that the pack backend for the alternate will be checked before the pack backend for the main repository *but* both of them will be checked before any loose backends.
* | | odb: Be smarter when refreshing backendsVicent Marti2015-10-142-154/+159
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the current implementation of ODB backends, each backend is tasked with refreshing itself after a failed lookup. This is standard Git behavior: we want to e.g. reload the packfiles on disk in case they have changed and that's the reason we can't find the object we're looking for. This behavior, however, becomes pathological in repositories where multiple alternates have been loaded. Given that each alternate counts as a separate backend, a miss in the main repository (which can potentially be very frequent in cases where object storage comes from the alternate) will result in refreshing all its packfiles before we move on to the alternate backend where the object will most likely be found. To fix this, the code in `odb.c` has been refactored as to perform the refresh of all the backends externally, once we've verified that the object is nowhere to be found. If the refresh is successful, we then perform the lookup sequentially through all the backends, skipping the ones that we know for sure weren't refreshed (because they have no refresh API). The on-disk pack backend has been adjusted accordingly: it no longer performs refreshes internally.
* | blame: guard xdiff calls for large filesEdward Thomson2015-10-053-9/+29
| |
* | diff: don't feed large files to xdiffEdward Thomson2015-10-057-17/+20
| |