Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-12-04index: canonicalize inserted paths safelyEdward Thomson
When adding to the index, we look to see if a portion of the given path matches a portion of a path in the index. If so, we will use the existing path information. For example, when adding `foo/bar.c`, if there is an index entry to `FOO/other` and the filesystem is case insensitive, then we will put `bar.c` into the existing tree instead of creating a new one with a different case. Use `strncmp` to do that instead of `memcmp`. When we `bsearch` into the index, we locate the position where the new entry would go. The index entry at that position does not necessarily have a relation to the entry we're adding, so we cannot make assumptions and use `memcmp`. Instead, compare them as strings. When canonicalizing paths, we look for the first index entry that matches a given substring.
2015-12-02tree: use a specialised mode parse functionCarlos Martín Nieto
Instead of going out to strtol, which is made to parse generic numbers, copy a parse function from git which is specialised for file modes.
2015-12-02CMakeLists: Compare CMAKE_SIZEOF_VOID_P as a number, not as a stringSebastian Schuberth
2015-12-01checkout test: Apply umask to file-mode test as wellMichał Górny
Fix the file-mode test to expect system umask being applied to the created file as well (it is currently applied to the directory only). This fixes the test on systems where umask != 022. Signed-off-by: Michał Górny <mgorny@gentoo.org>
2015-12-01Treat GIT_PASSTHROUGH as though git_cred_acquire_cb isn't set.Chris Hescock
2015-12-01Merge pull request #3527 from pks-t/pks/tree-entry-memleakEdward Thomson
tree: mark cloned tree entries as un-pooled
2015-12-01tree: mark cloned tree entries as un-pooledPatrick Steinhardt
When duplicating a `struct git_tree_entry` with `git_tree_entry_dup` the resulting structure is not allocated inside a memory pool. As we do a 1:1 copy of the original struct, though, we also copy the `pooled` field, which is set to `true` for pooled entries. This results in a huge memory leak as we never free tree entries that were duplicated from a pooled tree entry. Fix this by marking the newly duplicated entry as un-pooled.
2015-12-01diff: include commit message when formatting patchPatrick Steinhardt
When formatting a patch as email we do not include the commit's message in the formatted patch output. Implement this and add a test that verifies behavior.
2015-12-01commit: introduce `git_commit_body`Patrick Steinhardt
It is already possible to get a commit's summary with the `git_commit_summary` function. It is not possible to get the remaining part of the commit message, that is the commit message's body. Fix this by introducing a new function `git_commit_body`.
2015-12-01blame: use size_t for line counts in git_blame__entryPatrick Steinhardt
The `git_blame__entry` struct keeps track of line counts with `int` fields. Since `int` is only guaranteed to be at least 16 bits we may overflow on certain platforms when line counts exceed 2^15. Fix this by instead storing line counts in `size_t`.
2015-12-01blame: use size_t for line counts in git_blame_hunkPatrick Steinhardt
It is not unreasonable to have versioned files with a line count exceeding 2^16. Upon blaming such files we fail to correctly keep track of the lines as `git_blame_hunk` stores them in `uint16_t` fields. Fix this by converting the line fields of `git_blame_hunk` to `size_t`. Add test to verify behavior.
2015-12-01Merge pull request #3508 from libgit2/cmn/tree-parse-speedEdward Thomson
Improvements to tree parsing speed
2015-11-30Merge pull request #3525 from pks-t/pks/fix-nested-struct-warningCarlos Martín Nieto
Compiler warning fixes
2015-11-30object: remove unused constant OBJECT_BASE_SIZEPatrick Steinhardt
2015-11-30tests: fix warning for nested struct initializationPatrick Steinhardt
2015-11-30tree: ensure the entry filename fits in 16 bitsCarlos Martín Nieto
Return an error in case the length is too big. Also take this opportunity to have a single allocating function for the size and overflow logic.
2015-11-30Merge pull request #3513 from ethomson/merge_recursiveCarlos Martín Nieto
Recursive Merge
2015-11-28tree: make path len uint16_t and avoid holesCarlos Martín Nieto
This reduces the size of the struct from 32 to 26 bytes, and leaves a single padding byte at the end of the struct (which comes from the zero-length array).
2015-11-28tree: calculate the filename length onceCarlos Martín Nieto
We already know the size due to the `memchr()` so use that information instead of calling `strlen()` on it.
2015-11-28tree: pool the entry memory allocationsCarlos Martín Nieto
These are rather small allocations, so we end up spending a non-trivial amount of time asking the OS for memory. Since these entries are tied to the lifetime of their tree, we can give the tree a pool so we speed up the allocations.
2015-11-28tree: avoid advancing over the filename multiple timesCarlos Martín Nieto
We've already looked at the filename with `memchr()` and then used `strlen()` to allocate the entry. We already know how much we have to advance to get to the object id, so add the filename length instead of looking at each byte again.
2015-11-26recursive merge: add a recursion limitEdward Thomson
2015-11-25merge: handle conflicts in recursive base buildingEdward Thomson
When building a recursive merge base, allow conflicts to occur. Use the file (with conflict markers) as the common ancestor. The user has already seen and dealt with this conflict by virtue of having a criss-cross merge. If they resolved this conflict identically in both branches, then there will be no conflict in the result. This is the best case scenario. If they did not resolve the conflict identically in the two branches, then we will generate a new conflict. If the user is simply using standard conflict output then the results will be fairly sensible. But if the user is using a mergetool or using diff3 output, then the common ancestor will be a conflict file (itself with diff3 output, haha!). This is quite terrible, but it matches git's behavior.
2015-11-25merge tests: add complex recursive exampleEdward Thomson
2015-11-25recursive: test conflict output during recursive mergeEdward Thomson
2015-11-25merge tests: move expected data into own fileEdward Thomson
2015-11-25merge: use annotated commits for recursionEdward Thomson
Use annotated commits to act as our virtual bases, instead of regular commits, to avoid polluting the odb with virtual base commits and trees. Instead, build an annotated commit with an index and pointers to the commits that it was merged from.
2015-11-25merge: merge annotated commits instead of regular commitsEdward Thomson
2015-11-25merge: octopus merge common ancestors when >2Edward Thomson
When there are more than two common ancestors, continue merging the virtual base with the additional common ancestors, effectively octopus merging a new virtual base.
2015-11-25merge: add recursive test with conflicting contentsEdward Thomson
2015-11-25merge: compute octopus merge basesEdward Thomson
2015-11-25merge: add recursive test with three merge basesEdward Thomson
2015-11-25merge: improve test names in recursive merge testsEdward Thomson
2015-11-25merge: add a third-level recursive mergeEdward Thomson
2015-11-25merge: add a second-level recursive mergeEdward Thomson
2015-11-25merge: build virtual base of multiple merge basesEdward Thomson
When the commits to merge have multiple common ancestors, build a "virtual" base tree by merging the common ancestors.
2015-11-25merge: add simple recursive testEdward Thomson
Add a simple recursive test - where multiple ancestors exist and creating a virtual merge base from them would prevent a conflict.
2015-11-25merge: rename `git_merge_tree_flags_t` -> `git_merge_flags_t`Edward Thomson
2015-11-24Merge pull request #3523 from pks-t/memleak-fixesEdward Thomson
Memleak fixes
2015-11-24Merge pull request #3520 from ethomson/checkout_nsecsCarlos Martín Nieto
checkout: only consider nsecs when built that way
2015-11-24tests: win32::longpath: free expected_msgPatrick Steinhardt
2015-11-24tests: config::stress: free `git_config` structsPatrick Steinhardt
2015-11-24tests: config::global: fix memleak in open_programdataPatrick Steinhardt
2015-11-23checkout: only consider nsecs when built that wayEdward Thomson
When examining the working directory and determining whether it's up-to-date, only consider the nanoseconds in the index entry when built with `GIT_USE_NSEC`. This prevents us from believing that the working directory is always dirty when the index was originally written with a git client that uinderstands nsecs (like git 2.x).
2015-11-21Merge pull request #3515 from jacquesg/unsigned-signedEdward Thomson
Fix <0 unsigned comparison (stat.st_size should be an off_t)
2015-11-21Make stat.st_size a __int64 not a uint64_tJacques Germishuys
2015-11-21Merge pull request #3517 from jacquesg/warnings-fixesEdward Thomson
Fix some warnings
2015-11-21Merge pull request #3514 from jacquesg/stat-fixesEdward Thomson
Stat fixes
2015-11-20Merge pull request #3516 from libgit2/cmn/repository-state-sequencerEdward Thomson
repository: distinguish sequencer cherry-pick and revert
2015-11-20Detect stat's structureJacques Germishuys