|
0bfe5f78
|
2018-06-12T10:42:53
|
|
docs: fix statement about tab width
The libgit2 project mostly follows the coding style of git and thus
the linux project. While those two projects use a recommended tab width
of eight spaces, we instruct users to set their editor's tab width to
four spaces. Fix this to say eight instead.
|
|
795a5b28
|
2018-06-09T18:36:21
|
|
Merge pull request #4668 from novalis/bad-stash
Fix stash save bug with fast path index check
|
|
f81923ef
|
2018-06-09T18:31:57
|
|
Merge branch 'pks/docs-improvements'
|
|
8a2de353
|
2018-06-09T18:25:46
|
|
Merge branch 'compat/clibs'
|
|
5e53f216
|
2018-06-09T18:24:27
|
|
docs: update release steps to include clib manifest
We've introduced a manifest for the clib version system that includes a
version number; we should update it at release time to correspond with
the version number in the header.
|
|
5cd5f7bd
|
2018-04-22T12:03:40
|
|
Include clib's package reference.
This PR introduces a new top-level file, `package.json`, which enables this repository compatibility with [`clib`](https://github.com/clibs/clib), an open source C package manager. By doing this, users of `clib` can quickly include the `libgit2` library within their project.
|
|
44788c96
|
2018-06-09T18:00:23
|
|
Merge pull request #4662 from pks-t/pks/gitfile-api
path: unify `git_path_is_*` APIs
|
|
bc0f3227
|
2018-06-09T17:59:46
|
|
Merge pull request #4670 from pks-t/pks/ignore-leadingdir
Fix negative gitignore rules with leading directories
|
|
0ef3242e
|
2018-06-07T16:41:55
|
|
Merge pull request #4576 from pks-t/pks/memory-allocator
Custom memory allocators
|
|
496b0df2
|
2018-03-14T10:28:50
|
|
win32: crtdbg: provide independent `free` function
Currently, the `git__free` function is being defined in a single place,
only, disregarding whether we use our standard allocators or the crtdbg
allocators. This makes it a bit harder to convert our code base to use
pluggable allocators, and furthermore makes the border between our two
allocators a bit more blurry.
Implement a separate `git__crtdbg__free` function for the crtdbg
allocator in order to completely separate both allocator
implementations.
|
|
aab8f87b
|
2018-03-14T10:27:13
|
|
win32: crtdbg: internalize implementation of allocators
The crtdbg allocators are currently being implemented as inline
functions as part of the "w32_crtdbg_stacktrace.h" header. As we are
moving towards pluggable allocators with the help of function pointers,
though, we cannot make use of inlining anymore. Instead, we can only
have a single implementation of these allocating functions.
Move all implementations of the crtdbg allocators into
"w32_crtdbg_stacktrace.c".
|
|
0f6348f4
|
2018-05-18T13:27:26
|
|
CHANGELOG.md: update changelog to mention custom memory allocators
|
|
74b7ddbf
|
2018-03-16T10:14:50
|
|
settings: allow swapping out memory allocator
Tie in the newly created infrastructure for swapping out memory
allocators into our settings code. A user can now simply use the new
option "GIT_OPT_SET_ALLOCATOR" with `git_libgit2_opts`, passing in an
already initialized allocator structure as vararg.
|
|
9865cd16
|
2018-03-20T14:23:49
|
|
alloc: make memory allocators use function pointers
Currently, our memory allocators are being redirected to the correct
implementation at compile time by simply using macros. In order to make
them swappable at runtime, this commit reshuffles that by instead making
use of a global "git_allocator" structure, whose pointers are set up to
reference the allocator functions. Like this, it becomes easy to swap
out allocators by simply setting these function pointers.
In order to initialize a "git_allocator", our provided allocators
"stdalloc" and "crtdbg" both provide an init function. This is being
called to initialize a passed in allocator struct and set up its members
correctly.
No support is yet included to enable users of libgit2 to switch out the
memory allocator at a global level.
|
|
08b318c0
|
2018-03-14T10:43:00
|
|
stdalloc: extend allocators by file and line
Our desired architecture would make allocators completely pluggable,
such that users of libgit2 can swap out memory allocators at runtime.
While making e.g. debugging easier by not having to do a separate build,
this feature can also help maintainers of bindings for libgit2 by tying
the memory allocations into the other language's memory system.
In order to do so, though, we first need to make our two different
pre-existing allocators "stdalloc" and "crtdbg" have the same function
signatures, as the "crtdbg" allocators all have an additional file and
line argument. This is required to build correct stack traces for
debugging memory allocations. As that feature may also be interesting to
authors of other applications for debugging libgit2, we now simply add
these arguments to our standard allocators.
Obviously, this may come with a performance penalty. During some simple
benchmarks no real impact could be measured though in contrast to a
simple pluggable allocator. The following table summarizes the
benchmarks. There were three different builds with our current standard
allocator ("standard"), with pluggable authenticators accessed via
function pointers ("pluggable") and for pluggable authenticators with
file and line being added ("fileline"). Furthermore, there were three
scenarios for 100.000.000 allocations of 100B ("small alloc"),
100.000.000 allocations of 100KB ("medium alloc"), and 1.000.000
allocations of 100MB. All results are best of 10 runs.
|------------|-------------------|-------------------|-------------------|
| build/test | small alloc | medium alloc | big alloc |
|------------|-------------------|-------------------|-------------------|
| standard | 4539779566, +0.0% | 5912927186, +0.0% | 5166935308, +0.0% |
|------------|-------------------|-------------------|-------------------|
| pluggable | 4611074505, +1.5% | 5979185308, +1.1% | 5388776352, +4.2% |
|------------|-------------------|-------------------|-------------------|
| fileline | 4588338192, +1.1% | 6004951910, +1.5% | 4942528135, -4.4% |
|------------|-------------------|-------------------|-------------------|
As can be seen, there is a performance overhead for pluggable
allocators. Furthermore, it can also be seen that there is some big
variance between runs, especially in the "big alloc" scenario. This is
probably being caused by nondeterministic behaviour in the kernel for
dynamic allocations. Still, it can be observed that there should be no
real difference between the "pluggable" and "fileline" allocators.
|
|
d2e996fa
|
2018-03-14T10:36:14
|
|
util: extract allocators into its own "alloc.h" header
Our "util.h" header is a grabbag of various different functions, where
many don't have a clear group they belong to. Our set of allocator
functions though can be clearly singled out as a single group of
functions that always belongs together. Furthermore, we will need to
implement additional functions relating to our allocators subsystem when
moving to pluggable allocators. Thus, we should just move these
functions into their own "alloc" module.
|
|
c47f7155
|
2018-03-14T10:34:59
|
|
util: extract `stdalloc` allocator into its own module
Right now, the standard allocator is being declared as part of the
"util.h" header as a set of inline functions. As with the crtdbg
allocator functions, these inline functions make it hard to convert to
function pointers for our allocators.
Create a new "stdalloc" module containing our standard allocations
functions to split these out. Convert the existing allocators to macros
which make use of the stdalloc functions.
|
|
422cd59b
|
2018-06-07T12:49:55
|
|
Merge pull request #4655 from glaubitz/alignment
index: Fix alignment issues in write_disk_entry()
|
|
534b70af
|
2018-06-07T12:30:59
|
|
Merge pull request #4558 from tiennou/travis/war-on-leaks
travis: war on leaks
|
|
5a7d454b
|
2018-06-04T12:56:08
|
|
Fix stash save bug with fast path index check
If the index contains stat data for a modified file, and the file is
not racily dirty, and there exists an untracked working tree directory
alphabetically after that file, and there are no other changes to the
repo, then git_stash_save would fail. It would confuse the untracked
working tree directory for the modified file, because they have the
same sha: zero. The wt directory has a sha of zero because it's a
directory, and the file would have a zero sha because we wouldn't read
the file -- we would just know that it doesn't match the index. To
fix this confusion, we simply check mode as well as SHA.
|
|
20306d36
|
2018-06-06T14:31:28
|
|
Merge pull request #4665 from neithernut/fix-refdb-glob
refdb_fs: fix regression: failure when globbing for non-existant references
|
|
991bf691
|
2018-06-06T13:55:16
|
|
Merge pull request #4673 from pks-t/pks/submodule-dupes-simplify-test
tests: submodule: do not rely on config iteration order
|
|
74b0a432
|
2018-04-20T23:11:16
|
|
travis: split valgrind check in its own script
|
|
2f4e7cb0
|
2018-04-20T23:11:14
|
|
travis: split testing from building
|
|
61eaaadf
|
2018-04-20T23:11:30
|
|
travis: enable -Werror in the script instead of using the matrix
|
|
149790b9
|
2018-04-20T23:11:28
|
|
scripts: remove extraneous semicolons
|
|
4c969618
|
2018-04-20T23:11:27
|
|
scripts: use leaks on macOS
|
|
0fb8c1d0
|
2018-04-20T23:11:25
|
|
valgrind: bump num-callers to 50 for fuller stack traces
|
|
1f4ada2a
|
2018-04-20T23:11:23
|
|
travis: let cmake perform the build & install step
The goal is to let cmake manage the parallelism
|
|
234443e3
|
2018-04-20T23:11:22
|
|
valgrind: silence invalid free in libc atexit handler
==17851== Invalid free() / delete / delete[] / realloc()
==17851== at 0x4C2BDEC: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==17851== by 0x60BBE2B: __libc_freeres (in /lib/x86_64-linux-gnu/libc-2.19.so)
==17851== by 0x4A256BC: _vgnU_freeres (in /usr/lib/valgrind/vgpreload_core-amd64-linux.so)
==17851== by 0x5F8F16A: __run_exit_handlers (exit.c:97)
==17851== by 0x5F8F1F4: exit (exit.c:104)
==17851== by 0x5F74F4B: (below main) (libc-start.c:321)
==17851== Address 0x63153c0 is 0 bytes inside data symbol "noai6ai_cached"
|
|
dd75885a
|
2018-04-20T23:11:20
|
|
valgrind: silence libssh2 leaking something from gcrypt
==2957== 912 bytes in 19 blocks are still reachable in loss record 323 of 369
==2957== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2957== by 0x675B120: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==2957== by 0x675BDF8: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==2957== by 0x675FE0D: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==2957== by 0x6761DC4: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==2957== by 0x676477E: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==2957== by 0x675B071: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==2957== by 0x675B544: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==2957== by 0x675914B: gcry_control (in /lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==2957== by 0x5D30EC9: libssh2_init (in /usr/lib/x86_64-linux-gnu/libssh2.so.1.0.1)
==2957== by 0x66BCCD: git_transport_ssh_global_init (ssh.c:910)
==2957== by 0x616443: init_common (global.c:65)
|
|
573c4089
|
2018-04-20T23:11:19
|
|
valgrind: skip buf::oom test
|
|
c0c9e9ee
|
2018-04-20T23:11:17
|
|
valgrind: silence curl_global_init leaks
==18109== 664 bytes in 1 blocks are still reachable in loss record 279 of 339
==18109== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==18109== by 0x675B120: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==18109== by 0x675C13C: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==18109== by 0x675C296: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==18109== by 0x679BD14: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==18109== by 0x679CC64: ??? (in /lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==18109== by 0x6A64946: ??? (in /usr/lib/x86_64-linux-gnu/libgnutls.so.26.22.6)
==18109== by 0x6A116E8: ??? (in /usr/lib/x86_64-linux-gnu/libgnutls.so.26.22.6)
==18109== by 0x6A01114: gnutls_global_init (in /usr/lib/x86_64-linux-gnu/libgnutls.so.26.22.6)
==18109== by 0x52A6C78: ??? (in /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.3.0)
==18109== by 0x5285ADC: curl_global_init (in /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.3.0)
==18109== by 0x663524: git_curl_stream_global_init (curl.c:44)
|
|
8178c70f
|
2018-06-06T09:23:01
|
|
tests: submodule: do not rely on config iteration order
The test submodule::lookup::duplicated_path, which tries to verify that
we detect submodules with duplicated paths, currently relies on the
gitmodules file of "submod2_target". While this file has two gitmodules
with the same path, one of these gitmodules has an empty name and thus
does not pass `git_submodule_name_is_valid`. Because of this, the test
is in fact dependent on the iteration order in which we process the
submodules. In fact the "valid" submodule comes first, the "invalid"
submodule will cause the desired error. In fact the "invalid" submodule
comes first, it will be skipped due to its name being invalid, and we
will not see the desired error. While this works on the master branch
just right due to the refactoring of our config code, where iteration
order is now deterministic, this breaks on all older maintenance
branches.
Fix the issue by simply using `cl_git_rewritefile` to rewrite the
gitmodules file. This greatly simplifies the test and also makes the
intentions of it much clearer.
|
|
54990d75
|
2018-06-06T08:36:43
|
|
Merge pull request #4641 from pks-t/pks/submodule-names-memleak
Detect duplicated submodules for the same path
|
|
d22fd81c
|
2018-06-05T16:46:07
|
|
ignore: remove now-useless check for LEADINGDIR
When checking whether a rule negates another rule, we were checking
whether a rule had the `GIT_ATTR_FNMATCH_LEADINGDIR` flag set and, if
so, added a "/*" to its end before passing it to `fnmatch`. Our code now
sets `GIT_ATTR_FNMATCH_NOLEADINGDIR`, thus the `LEADINGDIR` flag shall
never be set. Furthermore, due to the `NOLEADINGDIR` flag, trailing
globs do not get consumed by our ignore parser anymore.
Clean up code by just dropping this now useless logic.
|
|
20b4c175
|
2018-06-05T16:12:58
|
|
ignore: fix negative leading directory rules unignoring subdirectory files
When computing whether a file is ignored, we simply search for the first
matching rule and return whether it is a positive ignore rule (the file
is really ignored) or whether it is a negative ignore rule (the file is
being unignored). Each rule has a set of flags which are being passed to
`fnmatch`, depending on what kind of rule it is. E.g. in case it is a
negative ignore we add a flag `GIT_ATTR_FNMATCH_NEGATIVE`, in case it
contains a glob we set the `GIT_ATTR_FNMATCH_HASGLOB` flag.
One of these flags is the `GIT_ATTR_FNMATCH_LEADINGDIR` flag, which is
always set in case the pattern has a trailing "/*" or in case the
pattern is negative. The flag causes the `fnmatch` function to return a
match in case a string is a leading directory of another, e.g. "dir/"
matches "dir/foo/bar.c". In case of negative patterns, this is wrong in
certain cases.
Take the following simple example of a gitignore:
dir/
!dir/
The `LEADINGDIR` flag causes "!dir/" to match "dir/foo/bar.c", and we
correctly unignore the directory. But take this example:
*.test
!dir/*
We expect everything in "dir/" to be unignored, but e.g. a file in a
subdirectory of dir should be ignored, as the "*" does not cross
directory hierarchies. With `LEADINGDIR`, though, we would just see that
"dir/" matches and return that the file is unignored, even if it is
contained in a subdirectory. Instead, we want to ignore leading
directories here and check "*.test". Afterwards, we have to iterate up
to the parent directory and do the same checks.
To fix the issue, disallow matching against leading directories in
gitignore files. This can be trivially done by just adding the
`GIT_ATTR_FNMATCH_NOLEADINGDIR` to the spec passed to
`git_attr_fnmatch__parse`. Due to a bug in that function, though, this
flag is being ignored for negative patterns, which is fixed in this
commit, as well. As a last fix, we need to ignore rules that are
supposed to match a directory when our path itself is a file.
All together, these changes fix the described error case.
|
|
9beb73ed
|
2018-06-05T16:45:23
|
|
tests: status::ignore: fix style of a test
|
|
d7eca4c3
|
2018-06-01T08:57:17
|
|
refdb_fs: add test for globbing of nonexistant refs
|
|
05e891f1
|
2018-06-01T08:44:30
|
|
refdb_fs: test whether the base directory exists when globbing
This commit fixes a regression introduced by
20a2b02d9a1bcb4825ec49605146223c565dcacf
The commit introduced an optimization for finding references using a
glob: rather than iterating over all references and matching each one
against the glob, we would iterate only over references within the
directory common to all possible references which may match against the
glob.
However, contrary to the `ref/` directory, which was the previous entry
point for the iteration, this directory may not exist. In this case, the
optimization causes an error (`ENOENT`) rather than the iterator simply
yielding no references.
This patch fixes the regression by checkign for this specific case.
|
|
bae6ed62
|
2018-06-01T13:17:28
|
|
Merge pull request #4530 from tiennou/fix/docurium-missing-includes
Fix docurium missing includes
|
|
93271f59
|
2018-05-25T01:41:33
|
|
index: Fix alignment issues in write_disk_entry()
In order to avoid alignment issues on certain target architectures,
it is necessary to use memcpy() when modifying elements of a struct
inside a buffer returned by git_filebuf_reserve().
|
|
92159bd4
|
2018-05-30T12:18:04
|
|
path: unify `git_path_is_*` APIs
Right now, there's quite a lot of different function calls to determine
whether a path component matches a specific name after normalization
from the filesystem. We have a function for each of {gitattributes,
gitmodules, gitignore} multiplicated with {generic, NTFS, HFS} checks.
In the long time, this is unmaintainable in case there are e.g. new
filesystems with specific semantics, blowing up the number of functions
we need to implement.
Replace all functions with a simple `git_path_is_gitfile` function,
which accepts an enum pointing out the filename that is to be checked
against as well as the filesystem normalizations to check for. This
greatly simplifies implementation at the expense of the caller having to
invoke a somewhat longer function call.
|
|
432dfda0
|
2018-03-22T09:32:28
|
|
README.md: detail how to list all build options
We do not list all build options inside of the README.md, and we
definitly shouldn't do so. But in order to help people discover what can
be configured, add instructions on how to have CMake generate the list
of all knobs together with their current value.
|
|
faf2629a
|
2018-03-22T09:27:18
|
|
README.md: fix link to `test_index_racy__diff`
The syntax for links is `[description](link)z, not the other way round.
Fix this.
|
|
68a3c0b1
|
2018-03-22T09:20:43
|
|
docs: reorganize documents
Our non-technical documents are currently floating around loosely in our
project's root, making it harden than necessary to discover what one is
searching for. We do have a "docs/" directory, though, which serves
exactly that purpose of hosting documentation.
Move our non-technical documentation into the "docs/" directory. Adjust
all links to these documents.
|
|
8f96cf9a
|
2018-03-22T09:13:18
|
|
README.md: add table of contents
By now, our README has grown quite long, and at multiple occassions
people were unable to find the correct spot in our documentation. Add a
table of contents to at least present an overview over all topics that
are being covered by our README.
|
|
771dfd1d
|
2018-05-30T10:52:51
|
|
Merge pull request #4627 from libgit2/ethomson/template
github: update issue template
|
|
8a14846b
|
2018-05-30T10:51:10
|
|
Merge pull request #4661 from laomaiweng/patch-1
streams: openssl: add missing check on OPENSSL_LEGACY_API
|
|
9c698a25
|
2018-05-30T10:34:58
|
|
submodule: remove useless mask computations
Previous to dfda2f68e (submodule: remove the per-repo cache,
2015-04-27), we tried to cache our submodules per repository to avoid
having to reload it too frequently. As it created some headaches with
regards to multithreading, we removed that cache.
Previous to that removal, we had to compute what submodule status to
refresh. The mask computation was not removed, though, resulting in
confusing and actually dead code. While it seems like the mask is
currently in use in a conditional, it is not, as we unconditionally
assign to the mask previous to that condition.
Remove all mask computations to clean up stale code.
|
|
cf5030a3
|
2018-05-30T08:38:28
|
|
submodule: refactor loading submodule names
The function `load_submodule_names` was always being called with a
newly allocated string map, which was then getting filled by the
function. Move the string map allocation into `load_submodule_names`,
instead, and pass the whole map back to the caller in case no error
occurs. This change helps to avoid misuse by handing in pre-populated
maps.
|
|
b2a389c8
|
2018-05-30T08:35:06
|
|
submodule: detect duplicated submodule paths
When loading submodule names, we build a map of submodule paths and
their respective names. While looping over the configuration keys,
we do not check though whether a submodule path was seen already. This
leads to a memory leak in case we have multiple submodules with the same
path, as we just overwrite the old value in the map in that case.
Fix the error by verifying that the path to be added is not yet part of
the string map. Git does not allow to have multiple submodules for a
path anyway, so we now do the same and detect this duplication,
reporting it to the user.
|
|
36ae5c93
|
2018-05-30T08:25:19
|
|
Merge pull request #4656 from tiennou/fix/mbedtls-no-pkgconfig
mbedtls: don't require mbedtls from our pkgconfig file
|
|
b1cab70b
|
2018-05-30T02:15:09
|
|
streams: openssl: add missing check on OPENSSL_LEGACY_API
The `CRYPTO_THREADID` type is no longer available in OpenSSL ≥ 1.1.0 with deprecated features disabled, and causes build failures. Since the `threadid_cb()` function is only ever called by `git_openssl_set_locking()` when `defined(OPENSSL_LEGACY_API)`, only define it then.
|
|
7f6c1ce9
|
2018-05-29T21:04:39
|
|
Merge pull request #4660 from libgit2/cmn/submodule-traversal
Fixes for CVE 2018-11235
|
|
491722e8
|
2018-05-29T19:27:59
|
|
CHANGELOG: mention fixes for CVE-2018-11235
|
|
64a78a80
|
2018-05-25T09:28:52
|
|
mbedtls: don't require mbedtls from our pkgconfig file
mbedTLS has no pkgconfig file, hence we can't require it. For now, pass its link flags as our own.
|
|
d050acf7
|
2018-05-25T10:28:15
|
|
Merge pull request #4653 from stinb/junction-point-diff-from-git
Added note about Windows junction points to the differences from git document
|
|
57e343d7
|
2018-05-24T21:58:40
|
|
path: hand-code the zero-width joiner as UTF-8
|
|
9e723db8
|
2018-05-24T20:28:36
|
|
submodule: plug leaks from the escape detection
|
|
c16ebaa6
|
2018-05-24T19:05:59
|
|
submodule: replace index with strchr which exists on Windows
|
|
91a4849d
|
2018-05-24T19:00:13
|
|
submodule: the repostiory for _name_is_valid should not be const
We might modify caches due to us trying to load the configuration to figure out
what kinds of filesystem protections we should have.
|
|
3fbfae26
|
2018-05-22T20:37:23
|
|
checkout: change symlinked .gitmodules file test to expect failure
When dealing with `core.proectNTFS` and `core.protectHFS` we do check
against `.gitmodules` but we still have a failing test as the non-filesystem
codepath does not check for it.
|
|
a7168b47
|
2018-05-22T16:13:47
|
|
path: reject .gitmodules as a symlink
Any part of the library which asks the question can pass in the mode to have it
checked against `.gitmodules` being a symlink.
This is particularly relevant for adding entries to the index from the worktree
and for checking out files.
|
|
58ff913a
|
2018-05-22T15:48:38
|
|
index: stat before creating the entry
This is so we have it available for the path validity checking. In a later
commit we will start rejecting `.gitmodules` files as symlinks.
|
|
1f570a29
|
2018-05-23T08:40:17
|
|
path: check for a symlinked .gitmodules in fs-agnostic code
We still compare case-insensitively to protect more thoroughly as we don't know
what specifics we'll see on the system and it's the behaviour from git.
|
|
02c80ad7
|
2018-05-22T15:21:08
|
|
path: accept the name length as a parameter
We may take in names from the middle of a string so we want the caller to let us
know how long the path component is that we should be checking.
|
|
a145f2b6
|
2018-05-22T14:16:45
|
|
checkout: add a failing test for refusing a symlinked .gitmodules
We want to reject these as they cause compatibility issues and can lead to git
writing to files outside of the repository.
|
|
490cbaa9
|
2018-05-22T13:58:24
|
|
path: expose dotgit detection functions per filesystem
These will be used by the checkout code to detect them for the particular
filesystem they're on.
|
|
d54c34a7
|
2018-05-21T17:04:11
|
|
docs: added note regarding difference in treatment of junction points from git
|
|
177dcfc7
|
2018-05-18T15:16:53
|
|
path: hide the dotgit file functions
These can't go into the public API yet as we don't want to introduce API or ABI
changes in a security release.
|
|
0aa65f8d
|
2018-05-16T15:56:04
|
|
path: add functions to detect .gitconfig and .gitattributes
|
|
9de97ae7
|
2018-05-16T15:42:08
|
|
path: add a function to detect an .gitmodules file
Given a path component it knows what to pass to the filesystem-specific
functions so we're protected even from trees which try to use the 8.3 naming
rules to get around us matching on the filename exactly.
The logic and test strings come from the equivalent git change.
|
|
22973e09
|
2018-05-16T14:47:04
|
|
path: provide a generic function for checking dogit files on NTFS
It checks against the 8.3 shortname variants, including the one which includes
the checksum as part of its name.
|
|
0283fc46
|
2018-05-16T11:56:04
|
|
path: provide a generic dogit checking function for HFS
This lets us check for other kinds of reserved files.
|
|
397abe98
|
2018-05-14T16:03:15
|
|
submodule: also validate Windows-separated paths for validity
Otherwise we would also admit `..\..\foo\bar` as a valid path and fail to
protect Windows users.
Ideally we would check for both separators without the need for the copied
string, but this'll get us over the RCE.
|
|
6b15ceac
|
2018-04-30T13:47:15
|
|
submodule: ignore submodules which include path traversal in their name
If the we decide that the "name" of the submodule (i.e. its path inside
`.git/modules/`) is trying to escape that directory or otherwise trick us, we
ignore the configuration for that submodule.
This leaves us with a half-configured submodule when looking it up by path, but
it's the same result as if the configuration really were missing.
The name check is potentially more strict than it needs to be, but it lets us
re-use the check we're doing for the checkout. The function that encapsulates
this logic is ready to be exported but we don't want to do that in a security
release so it remains internal for now.
|
|
f9cf9a04
|
2018-05-09T14:51:57
|
|
Merge pull request #4642 from pks-t/pks/cmake-resolve-pkgconfig
cmake: resolve libraries found by pkg-config
|
|
0a19c151
|
2018-05-09T14:14:06
|
|
Merge pull request #4629 from neithernut/enhance-glob-perf
refdb_fs: enhance performance of globbing
|
|
81c9894f
|
2018-05-09T14:06:57
|
|
Merge pull request #4645 from pks-t/pks/racy-init-deinit
global: adjust init count under lock
|
|
6c2939d6
|
2018-05-09T13:57:17
|
|
Merge pull request #4646 from pks-t/pks/gcc-8.1-warnings
Fix GCC 8.1 warnings
|
|
8ab470f5
|
2018-04-27T15:31:43
|
|
cmake: remove now-useless LIBGIT2_LIBDIRS handling
With the recent change of always resolving pkg-config libraries to their
full path, we do not have to manage the LIBGIT2_LIBDIRS variable
anymore. The only other remaining user of LIBGIT2_LIBDIRS is winhttp,
which is a CMake-style library target and can thus be resolved by CMake
automatically.
Remove the variable to simplify our build system a bit.
|
|
0f62e4c7
|
2018-04-27T10:38:49
|
|
cmake: resolve libraries found by pkg-config
Libraries found by CMake modules are usually handled with their full
path. This makes linking against those libraries a lot more robust when
it comes to libraries in non-standard locations, as otherwise we might
mix up libraries from different locations when link directories are
given.
One excemption are libraries found by PKG_CHECK_MODULES. Instead of
returning libraries with their complete path, it will return the
variable names as well as a set of link directories. In case where
multiple sets of the same library are installed in different locations,
this can lead the compiler to link against the wrong libraries in the
end, when link directories of other dependencies are added.
To fix this shortcoming, we need to manually resolve library paths
returned by CMake against their respective library directories. This is
an easy task to do with `FIND_LIBRARY`.
|
|
04c48afc
|
2018-04-20T21:07:17
|
|
docs: standardize struct git_*_options comments
|
|
c7b42f44
|
2018-04-11T22:26:31
|
|
docs: fix comment style
|
|
3ec35d9c
|
2018-03-26T20:23:59
|
|
attr: fix typo
|
|
78ea5adc
|
2018-03-22T23:27:35
|
|
branch: typo
|
|
bf46d458
|
2018-03-22T23:27:34
|
|
docs: move blame options struct field comments
|
|
132f2ce0
|
2018-03-22T23:27:33
|
|
docs: change Docurium input directory
Most files under `git2/sys` have their includes prefixed with `git2`. Since Docurium exports its input headers in a temporary directory without the `git2` prefix, all those headers fail to parse.
|
|
25e8a293
|
2018-03-22T23:27:31
|
|
docs: correct defgroup
|
|
29afb257
|
2018-03-22T23:27:30
|
|
docs: fix incorrect codeblock on output
|
|
bf70fa4b
|
2018-03-22T23:27:28
|
|
docs: move comment so docurium sees it
|
|
ca5a15e5
|
2018-03-22T23:27:27
|
|
docs: standardize comment block for git_*_init_options functions
|
|
8ee183a2
|
2018-03-22T23:27:25
|
|
docs: missing documentation comment
|
|
f46c360e
|
2018-03-22T23:27:24
|
|
docs: move callback-specific documentation to the callback
|
|
efad967a
|
2018-03-22T23:27:23
|
|
docs: fix some comment-marker typos
|
|
96576372
|
2018-03-22T23:27:21
|
|
docs: fix more missing includes
|
|
84bcae6c
|
2018-03-22T23:27:20
|
|
docs: add buffer.h & oid.h to types.h
Otherwise docurium/clang chokes on the types, and ignores the documentation comments altogether.
|
|
81ea9957
|
2018-05-07T15:36:40
|
|
Merge pull request #4630 from tiennou/fix/worktree-from-bare
Worktrees can be made from bare repositories
|
|
a82082d0
|
2018-04-20T08:38:50
|
|
worktree: a worktree can be made from a bare repository
|