|
488e2b85
|
2016-02-09T16:26:58
|
|
Merge pull request #3599 from libgit2/gpgsign
Introduce git_commit_extract_signature
|
|
534cc5a3
|
2016-02-09T16:10:43
|
|
Merge pull request #3603 from pks-t/pks/coverity-fixes
Coverity fixes
|
|
a65afb75
|
2016-02-08T18:51:13
|
|
Introduce git_commit_extract_signature
This returns the GPG signature for a commit and its contents without the
signature block, allowing for the verification of the commit's
signature.
|
|
ab87cb18
|
2016-02-09T14:53:10
|
|
Merge pull request #3602 from libgit2/cmn/header-field-2
commit: also match the first header field when searching
|
|
24b8ed2b
|
2016-02-09T11:11:38
|
|
attr_file: fix resource leak
|
|
e2625457
|
2016-02-09T11:07:50
|
|
checkout: fix resource leak
|
|
39c9dd24
|
2016-02-09T10:53:30
|
|
pack-objects: fix memory leak in packbuilder_config
|
|
0b2437bb
|
2016-02-09T10:43:28
|
|
pack-objects: fix memory leak in compute_write_order
|
|
a53d2e39
|
2016-02-09T09:58:56
|
|
pack: do not free passed in poiter on error
The function `git_packfile_stream_open` tries to free the passed
in stream when an error occurs. The only call site is
`git_indexer_append`, though, which passes in the address of a
stream struct which has not been allocated on the heap.
Fix the issue by simply removing the call to free. In case of an
error we did not allocate any memory yet and otherwise it should
be the caller's responsibility to manage it's object's lifetime.
|
|
f55eca16
|
2016-02-09T07:17:26
|
|
commit: also match the first header field when searching
We were searching only past the first header field, which meant we were
unable to find e.g. `tree` which is the first field.
While here, make sure to set an error message in case we cannot find the
field.
|
|
a001846b
|
2016-02-08T17:05:57
|
|
curl_stream: fix unused cert infos
When copying contents of the cURL certiinfo we duplicate the
data but forget to actually put it into the vector.
|
|
fac42ff9
|
2016-02-08T16:58:08
|
|
merge: fix memory leak
|
|
240b6fed
|
2016-02-05T15:19:24
|
|
Merge pull request #3578 from bubaflub/fix_small_memory_leak
Free allocated pointer to curl stream on error
|
|
5c7f2f01
|
2016-01-19T11:13:23
|
|
winhttp: name mangle class / iid on mingw
Standard Windows type systems define CLSID_InternetSecurityManager
and IID_IInternetSecurityManager, but MinGW lacks these definitions.
As a result, we must hardcode these definitions ourselves. However,
we should not use a public struct with those names, lest another
library do the same thing and consumers cannot link to both.
|
|
8bd1c19e
|
2016-01-16T19:39:24
|
|
Free allocated pointer to curl stream on error
|
|
b644e223
|
2016-01-13T11:02:38
|
|
Make packfile_unpack_compressed a private API
|
|
700f0aff
|
2015-12-29T13:38:01
|
|
Merge pull request #3562 from mgorny/ssh-read-stderr-fail
ssh_stream_read(): fix possible *bytes_read < 0 branch
|
|
a3776489
|
2015-12-28T15:12:37
|
|
Merge pull request #3558 from libgit2/cmn/index-nolock
index: get rid of the locking
|
|
9d81509a
|
2015-12-23T11:54:52
|
|
index: get rid of the locking
We don't support using an index object from multiple threads at the same
time, so the locking doesn't have any effect when following the
rules. If not following the rules, things are going to break down
anyway.
|
|
62602547
|
2015-12-26T22:39:22
|
|
git_repository_init: include dotfiles when copying templates
Include dotfiles when copying template directory, which will handle
both a template directory itself that begins with a dotfile, and
any dotfiles inside the directory.
|
|
869320a8
|
2015-12-26T16:55:29
|
|
Merge pull request #3546 from Cruel/master
Fix a couple function signatures
|
|
02fdc2db
|
2015-12-26T17:17:05
|
|
ssh_stream_read(): fix possible *bytes_read < 0 branch
Fix the possibility of returning successfully from ssh_stream_read()
with *bytes_read < 0. This would occur if stdout channel read resulted
in 0, and stderr channel read failed afterwards.
|
|
91f0d186
|
2015-12-21T20:49:14
|
|
typos in comments
|
|
ef8b7feb
|
2015-12-16T19:36:50
|
|
index: Also size-hint the hash table
Note that we're not checking whether the resize succeeds; in OOM cases,
we let it run with a "small" vector and hash table and see if by chance
we can grow it dynamically as we insert the new entries. Nothing to
lose really.
|
|
d7d46cfb
|
2015-12-16T17:00:25
|
|
index: Preallocate the entries vector with size hint
|
|
0cc20a8c
|
2015-12-16T16:53:06
|
|
index: Adjust namemask & mode when filling
|
|
879ebab3
|
2015-12-16T12:30:52
|
|
merge: Use `git_index__fill` to populate the index
Instead of calling `git_index_add` in a loop, use the new
`git_index_fill` internal API to fill the index with the initial staged
entries.
The new `fill` helper assumes that all the entries will be unique and
valid, so it can append them at the end of the entries vector and only
sort it once at the end. It performs no validation checks.
This prevents the quadratic behavior caused by having to sort the
entries list once after every insertion.
|
|
95746a57
|
2015-12-14T19:21:09
|
|
Fix a couple function signatures
|
|
7f2c1469
|
2015-12-14T13:54:02
|
|
Merge pull request #3528 from chescock/Passthrough-from-credential-callback
Treat GIT_PASSTHROUGH as though git_cred_acquire_cb isn't set.
|
|
30c8e260
|
2015-12-14T13:53:26
|
|
Merge pull request #3521 from pks-t/blame-line-overflow
Line count overflow in git_blame_hunk and git_blame__entry
|
|
6aa06b65
|
2015-12-10T12:14:09
|
|
Merge pull request #3522 from pks-t/email-format-commit-message
diff: include commit message when formatting patch
|
|
dc49eb58
|
2015-12-10T11:57:44
|
|
Merge pull request #3538 from pks-t/pks/index-memory-leak
index: always queue `remove_entry` for removal
|
|
465c3b38
|
2015-12-09T19:16:11
|
|
reset: perform the checkout before moving HEAD or the index
This keeps the state of the workdir the same as one from HEAD, removing
a source of possible confusion when calculating the work that is to be
done.
|
|
21b1e015
|
2015-12-08T21:11:58
|
|
Merge pull request #3539 from libgit2/typedef-submodule-cb
Use a typedef for the submodule_foreach callback.
|
|
eda726cf
|
2015-12-08T11:34:00
|
|
Use a typedef for the submodule_foreach callback.
This fits with the style for the rest of the project, but more
importantly, makes life easier for bindings authors who auto-generate
code.
|
|
b057fdef
|
2015-12-08T16:00:35
|
|
index: always queue `remove_entry` for removal
When replacing an index with a new one, we need to iterate
through all index entries in order to determine which entries are
equal. When it is not possible to re-use old entries for the new
index, we move it into a list of entries that are to be removed
and thus free'd.
When we encounter a non-zero error code, though, we skip adding
the current index entry to the remove-queue. `INSERT_MAP_EX`,
which is the function last run before adding to the remove-queue,
may return a positive non-zero code that indicates what exactly
happened while inserting the element. In this case we skip adding
the entry to the remove-queue but still continue the current
operation, leading to a leak of the current entry.
Fix this by checking for a negative return value instead of a
non-zero one when we want to add the current index entry to the
remove-queue.
|
|
fc436469
|
2015-12-06T22:51:00
|
|
tree: mark a tree as already sorted
The trees are sorted on-disk, so we don't have to go over them
again. This cuts almost a fifth of time spent parsing trees.
|
|
5d1f31c6
|
2015-12-03T17:42:52
|
|
Merge pull request #3530 from libgit2/cmn/parse-mode
tree: use a specialised mode parse function
|
|
626f9e24
|
2015-12-03T16:27:15
|
|
index: canonicalize inserted paths safely
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.
|
|
0174f21b
|
2015-12-02T18:56:31
|
|
tree: use a specialised mode parse function
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.
|
|
efd9ab56
|
2015-11-20T11:26:26
|
|
Treat GIT_PASSTHROUGH as though git_cred_acquire_cb isn't set.
|
|
9487585d
|
2015-12-01T14:19:29
|
|
tree: mark cloned tree entries as un-pooled
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.
|
|
254e0a33
|
2015-11-24T13:43:43
|
|
diff: include commit message when formatting patch
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.
|
|
7f8fe1d4
|
2015-12-01T10:03:56
|
|
commit: introduce `git_commit_body`
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`.
|
|
944dbd12
|
2015-11-24T10:52:17
|
|
blame: use size_t for line counts in git_blame__entry
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`.
|
|
cb1cb24c
|
2015-11-24T10:18:58
|
|
blame: use size_t for line counts in git_blame_hunk
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.
|
|
337b2b08
|
2015-11-30T20:53:54
|
|
Merge pull request #3508 from libgit2/cmn/tree-parse-speed
Improvements to tree parsing speed
|
|
bbd2fa4e
|
2015-11-30T18:05:27
|
|
object: remove unused constant OBJECT_BASE_SIZE
|
|
95ae3520
|
2015-11-30T17:32:18
|
|
tree: ensure the entry filename fits in 16 bits
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.
|
|
a27f31d8
|
2015-11-30T04:49:31
|
|
Merge pull request #3513 from ethomson/merge_recursive
Recursive Merge
|
|
ee42bb0e
|
2015-11-28T19:18:29
|
|
tree: make path len uint16_t and avoid holes
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).
|
|
2580077f
|
2015-11-15T00:44:02
|
|
tree: calculate the filename length once
We already know the size due to the `memchr()` so use that information
instead of calling `strlen()` on it.
|
|
ed970748
|
2015-11-14T23:50:06
|
|
tree: pool the entry memory allocations
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.
|
|
7132150d
|
2015-11-14T23:46:21
|
|
tree: avoid advancing over the filename multiple times
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.
|
|
5b9c63c3
|
2015-11-20T19:01:42
|
|
recursive merge: add a recursion limit
|
|
78859c63
|
2015-11-20T17:33:49
|
|
merge: handle conflicts in recursive base building
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.
|
|
76ade3a0
|
2015-11-10T21:21:26
|
|
merge: use annotated commits for recursion
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.
|
|
7730fe8e
|
2015-11-09T13:01:48
|
|
merge: merge annotated commits instead of regular commits
|
|
3f2bb387
|
2015-10-28T11:00:55
|
|
merge: octopus merge common ancestors when >2
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.
|
|
1b82f7b6
|
2015-10-27T14:24:51
|
|
merge: compute octopus merge bases
|
|
75dee59c
|
2015-10-26T10:37:58
|
|
merge: build virtual base of multiple merge bases
When the commits to merge have multiple common ancestors, build a
"virtual" base tree by merging the common ancestors.
|
|
fa78782f
|
2015-10-22T17:00:09
|
|
merge: rename `git_merge_tree_flags_t` -> `git_merge_flags_t`
|
|
25e84f95
|
2015-11-23T15:49:54
|
|
checkout: only consider nsecs when built that way
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).
|
|
66e4e6da
|
2015-11-21T11:26:18
|
|
Merge pull request #3515 from jacquesg/unsigned-signed
Fix <0 unsigned comparison (stat.st_size should be an off_t)
|
|
e78e8fae
|
2015-11-20T20:22:38
|
|
Make stat.st_size a __int64 not a uint64_t
|
|
7a612b53
|
2015-11-20T17:52:00
|
|
Merge pull request #3514 from jacquesg/stat-fixes
Stat fixes
|
|
eb11fac6
|
2015-11-20T18:57:13
|
|
Detect stat's structure
|
|
2ea40fda
|
2015-11-20T13:19:23
|
|
repository: distinguish sequencer cherry-pick and revert
These are not quite like their plain counterparts and require special handling.
|
|
69d14948
|
2015-11-17T13:21:18
|
|
Merge pull request #3511 from ethomson/racy_fixes_2
Racy fixes for writing new indexes
|
|
3eac1037
|
2015-11-16T23:31:19
|
|
settings: allow users to set PROGRAMDATA
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.
|
|
5f32c506
|
2015-11-16T18:06:52
|
|
racy: make git_index_read_index handle raciness
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.
|
|
27bc41cf
|
2015-11-13T16:31:51
|
|
index: clear uptodate bit on save
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.
|
|
d1101263
|
2015-11-13T15:32:48
|
|
index: don't detect raciness in uptodate entries
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.
|
|
cb0ff012
|
2015-11-06T17:15:35
|
|
racy-git: do a single index->workdir diff
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.
|
|
7ff7ca62
|
2015-11-12T20:51:01
|
|
pool: Never return unaligned buffers
|
|
75a0ccf5
|
2015-11-12T19:53:09
|
|
Merge pull request #3170 from CmdrMoozy/nsec_fix
git_index_entry__init_from_stat: set nsec fields in entry stats
|
|
2c26c867
|
2015-11-12T19:22:31
|
|
Merge pull request #3499 from ethomson/ref_dir_errmsgs
Improve error messages when dirs prevent ref/reflog creation
|
|
ecdc0428
|
2015-11-12T19:20:36
|
|
Merge pull request #3448 from libgit2/cmn/custom-agent
Support setting custom user-agent
|
|
1411cb9e
|
2015-10-02T03:57:14
|
|
winhttp: use a custom user-agent if the user has set it
We also keep the "git/1.0" prefix in order to maintain compatibility
with hosters.
|
|
94bac76c
|
2015-10-02T03:46:34
|
|
http: use a custom user-agent if the user has set it
We still prefix it with "git/1.0" since that's required in many
situations, but we replace the area which mentions libgit2.
|
|
de870533
|
2015-10-02T03:43:11
|
|
settings: add a setter for a custom user-agent
|
|
0a700ee3
|
2015-11-03T17:34:54
|
|
reflog: error when a directory is at reflog path
When a non-empty directory exists and prevents the creation of a
reflog, provide a more informative error message.
|
|
b46c7ee5
|
2015-11-03T17:18:00
|
|
refs: complain when a directory exists at ref
When a (non-empty) directory exists at the reference target
location, complain with a more actionable error message.
|
|
ad8509ef
|
2015-11-12T11:54:06
|
|
index: overwrite the path when inserting conflicts
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.
|
|
16604d74
|
2015-11-11T00:36:15
|
|
index: correctly report which conflict stage has a wrong filemode
When we're at offset 'i', we're dealing with the 'i+1' stage, since
conflicts start at 1.
|
|
1c34b717
|
2015-11-08T05:10:18
|
|
Merge pull request #3498 from ethomson/windows_symlinks
Diff: Honor `core.symlinks=false` and fake symlinks
|
|
61948894
|
2015-11-08T04:54:55
|
|
Merge pull request #3500 from ethomson/submodules_with_path
Handle submodules with paths in `git_submodule_update`
|
|
f4b02671
|
2015-11-04T16:17:51
|
|
submodule: reload HEAD/index after reading config
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.
|
|
5aa28a8f
|
2015-11-04T14:16:24
|
|
Merge pull request #3465 from libgit2/cmn/tls-register
stream: allow registering a user-provided TLS constructor
|
|
f5f96a23
|
2015-10-09T10:41:06
|
|
Fix git_commit_summary to convert newlines to spaces even after
whitespace. Collapse spaces around newlines for the summary.
|
|
ec50b23a
|
2015-11-03T17:02:07
|
|
filebuf: detect directories in our way
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.
|
|
6b0fc6ab
|
2015-11-03T09:43:18
|
|
diff: on win32, treat fake "symlinks" specially
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.
|
|
7fafde63
|
2015-10-13T11:25:41
|
|
stream: allow registering a user-provided TLS constructor
This allows the application to use their own TLS stream, regardless of
the capabilities of libgit2 itself.
|
|
d39f643a
|
2015-10-13T19:34:07
|
|
stream: accept NULL in the free function
|
|
3138ad93
|
2015-07-16T10:17:16
|
|
Add diff progress callback.
|
|
db1edf91
|
2015-11-02T15:09:19
|
|
Merge pull request #3491 from libgit2/cmn/config-checksum
Use checksums to detect config file changes
|
|
1d0bed9d
|
2015-10-30T14:02:01
|
|
merge-base: Style
|
|
4cacf5b5
|
2015-10-30T11:50:43
|
|
merge-base: Do not read parents from the root
|
|
136a71f4
|
2015-10-30T11:45:52
|
|
merge-base: Remove redundant merge bases
|
|
3547b122
|
2015-10-30T21:36:51
|
|
filebuf: use an internal buffer
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.
|