|
7a3f1de5
|
2016-08-22T09:27:47
|
|
filesystem_iterator: fixed double free on error
|
|
c1b370e9
|
2016-08-17T09:24:44
|
|
Merge pull request #3837 from novalis/dturner/indexv4
Support index v4
|
|
635a9222
|
2016-08-17T08:54:48
|
|
Merge pull request #3895 from pks-t/pks/negate-basename-in-subdirs
ignore: allow unignoring basenames in subdirectories
|
|
fcb2c1c8
|
2016-08-12T09:06:15
|
|
ignore: allow unignoring basenames in subdirectories
The .gitignore file allows for patterns which unignore previous
ignore patterns. When unignoring a previous pattern, there are
basically three cases how this is matched when no globbing is
used:
1. when a previous file has been ignored, it can be unignored by
using its exact name, e.g.
foo/bar
!foo/bar
2. when a file in a subdirectory has been ignored, it can be
unignored by using its basename, e.g.
foo/bar
!bar
3. when all files with a basename are ignored, a specific file
can be unignored again by specifying its path in a
subdirectory, e.g.
bar
!foo/bar
The first problem in libgit2 is that we did not correctly treat
the second case. While we verified that the negative pattern
matches the tail of the positive one, we did not verify if it
only matches the basename of the positive pattern. So e.g. we
would have also negated a pattern like
foo/fruz_bar
!bar
Furthermore, we did not check for the third case, where a
basename is being unignored in a certain subdirectory again.
Both issues are fixed with this commit.
|
|
5625d86b
|
2016-05-17T15:40:32
|
|
index: support index v4
Support reading and writing index v4. Index v4 uses a very simple
compression scheme for pathnames, but is otherwise similar to index v3.
Signed-off-by: David Turner <dturner@twitter.com>
|
|
aeb5ee5a
|
2016-05-17T15:40:46
|
|
varint: Add varint encoding/decoding
This code is ported from git.git
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: David Turner <dturner@twopensource.com>
|
|
26a8617d
|
2016-08-09T14:34:55
|
|
Merge pull request #3891 from pks-t/pks/stransport-memory-management-improvements
stransport memory management improvements
|
|
5961face
|
2016-08-09T08:07:10
|
|
Merge pull request #3893 from pks-t/pks/remove-unused-test-cb
tests: blob: remove unused callback function
|
|
4006455f
|
2016-08-09T10:09:23
|
|
tests: blob: remove unused callback function
|
|
b9895144
|
2016-08-08T14:47:32
|
|
stransport: do not use `git_stream_free` on uninitialized stransport
When failing to initialize a new stransport stream, we try to
release already allocated memory by calling out to
`git_stream_free`, which in turn called out to the stream's
`free` function pointer. As we only initialize the function
pointer later on, this leads to a `NULL` pointer exception.
Furthermore, plug another memory leak when failing to create the
SSL context.
|
|
97e57e87
|
2016-08-08T15:13:59
|
|
Merge pull request #3887 from libgit2/ethomson/empty_blob
odb: only provide the empty tree
|
|
b47e79e2
|
2016-08-08T08:42:32
|
|
Merge pull request #3890 from pks-t/pks/stransport-static-linkage
stransport: make internal functions static
|
|
067bf5dc
|
2016-08-08T13:49:17
|
|
stransport: make internal functions static
|
|
0fd5a44d
|
2016-08-08T13:12:51
|
|
Merge pull request #3888 from libgit2/ethomson/doc_diff_from_buffer
diff: document `git_diff_from_buffer`
|
|
9bc8c80f
|
2016-08-05T20:34:19
|
|
odb: actually insert the empty blob in tests
|
|
e2e7f31a
|
2016-08-05T20:00:22
|
|
diff: document `git_diff_from_buffer`
|
|
becadafc
|
2016-08-05T19:30:56
|
|
odb: only provide the empty tree
Only provide the empty tree internally, which matches git's behavior.
If we provide the empty blob then any users trying to write it with
libgit2 would omit it from actually landing in the odb, which appear
to git proper as a broken repository (missing that object).
|
|
56bbdf93
|
2016-08-05T14:23:29
|
|
Merge pull request #3886 from libgit2/cmn/copypeertrust-null
SecureTransport: handle NULL trust on success
|
|
9884dd61
|
2016-08-05T18:40:37
|
|
SecureTransport: handle NULL trust on success
The `SSLCopyPeerTrust` call can succeed but fail to return a trust
object if it can't load the certificate chain and thus cannot check the
validity of a certificate. This can lead to us calling `CFRelease` on a
`NULL` trust object, causing a crash.
Handle this by returning ECERTIFICATE.
|
|
c550c922
|
2016-08-05T18:24:28
|
|
Merge pull request #3881 from pks-t/pks/fix-clar-suite-prefix-computation
clar: fix parsing of test suite prefixes
|
|
cba60b9b
|
2016-08-05T09:10:58
|
|
Merge pull request #3884 from pks-t/pks/patch-image-initialization
Patch image initialization
|
|
274a727e
|
2016-08-05T10:57:42
|
|
apply: fix warning when initializing patch images
|
|
844f5b20
|
2016-08-05T10:57:13
|
|
pool: provide macro to statically initialize git_pool
|
|
73dab769
|
2016-08-04T16:16:16
|
|
Merge pull request #3861 from libgit2/ethomson/refresh_objects
odb: freshen existing objects when writing
|
|
27051d4e
|
2016-07-22T13:34:19
|
|
odb: only freshen pack files every 2 seconds
Since writing multiple objects may all already exist in a single
packfile, avoid freshening that packfile repeatedly in a tight loop.
Instead, only freshen pack files every 2 seconds.
|
|
8f09a98e
|
2016-07-14T16:23:24
|
|
odb: freshen existing objects when writing
When writing an object, we calculate its OID and see if it exists in the
object database. If it does, we need to freshen the file that contains
it.
|
|
d2794b0e
|
2016-08-04T20:49:50
|
|
Merge pull request #3877 from libgit2/ethomson/paths_init
sysdir: don't assume an empty dir is uninitialized
|
|
0d84de02
|
2016-08-04T13:20:49
|
|
Merge pull request #3869 from richardipsum/fix-outdated-comment
Fix outdated comment
|
|
78b500bf
|
2016-08-04T12:45:19
|
|
Merge pull request #3850 from wildart/custom-tls
Enable https transport for custom TLS streams
|
|
031d34b7
|
2016-07-29T12:59:42
|
|
sysdir: use the standard `init` pattern
Don't try to determine when sysdirs are uninitialized. Instead, simply
initialize them all at `git_libgit2_init` time and never try to
reinitialize, except when consumers explicitly call `git_sysdir_set`.
Looking at the buffer length is especially problematic, since there may
no appropriate path for that value. (For example, the Windows-specific
programdata directory has no value on non-Windows machines.)
Previously we would continually trying to re-lookup these values,
which could get racy if two different threads are each calling
`git_sysdir_get` and trying to lookup / clear the value simultaneously.
|
|
da7f9feb
|
2016-08-04T11:51:06
|
|
Merge pull request #3879 from libgit2/ethomson/mwindow_init
mwindow: init mwindow files in git_libgit2_init
|
|
2381d9e4
|
2016-08-03T17:01:48
|
|
mwindow: init mwindow files in git_libgit2_init
|
|
f2cab0a6
|
2016-08-04T11:49:39
|
|
clar: fix parsing of test suite prefixes
When passing in a specific suite which should be executed by clar
via `-stest::suite`, we try to parse this string and then include
all tests contained in this suite. This also includes all tests
in sub-suites, e.g. 'test::suite::foo'.
In the case where multiple suites start with the same _string_,
for example 'test::foo' and 'test::foobar', we fail to
distinguish this correctly. When passing in `-stest::foobar`,
we wrongly determine that 'test::foo' is a prefix and try to
execute all of its matching functions. But as no function
will now match 'test::foobar', we simply execute nothing.
To fix this, we instead have to check if the prefix is an actual
suite prefix as opposed to a simple string prefix. We do so by by
inspecting if the first two characters trailing the prefix are
our suite delimiters '::', and only consider the filter as
matching in this case.
|
|
baa87dfc
|
2016-08-03T22:00:21
|
|
Merge pull request #3880 from libgit2/ethomson/diff_file
git_diff_file: move `id_abbrev`
|
|
002c8e29
|
2016-08-03T17:09:41
|
|
git_diff_file: move `id_abbrev`
Move `id_abbrev` to a more reasonable place where it packs more nicely
(before anybody starts using it).
|
|
152efee2
|
2016-08-02T18:43:12
|
|
Merge pull request #3865 from libgit2/ethomson/leaks
Fix leaks, some warnings and an error
|
|
df87648a
|
2016-07-24T16:10:30
|
|
crlf: set a safe crlf default
|
|
a37624ec
|
2016-07-24T16:05:17
|
|
Merge pull request #3815 from pks-t/pks/coverity-model
Coverity user model
|
|
76cfdd46
|
2016-07-24T15:51:13
|
|
Merge pull request #3862 from novalis/dturner/do-not-die-on-missing-config
remote: Handle missing config values when deleting a remote
|
|
b118f647
|
2016-07-22T14:02:00
|
|
repository: don't cast to `int` for no reason
And give it a default so that some compilers don't (unnecessarily)
complain.
|
|
4aaae935
|
2016-07-22T12:53:13
|
|
index: cast to avoid warning
|
|
498d0801
|
2016-07-22T12:01:24
|
|
tests: use a `size_t`
|
|
60e15ecd
|
2016-07-15T17:18:39
|
|
packbuilder: `size_t` all the things
After 1cd65991, we were passing a pointer to an `unsigned long` to
a function that now expected a pointer to a `size_t`. These types
differ on 64-bit Windows, which means that we trash the stack.
Use `size_t`s in the packbuilder to avoid this.
|
|
581a4d39
|
2016-07-14T23:32:35
|
|
apply: safety check files that dont end with eol
|
|
c065f6a1
|
2016-07-14T23:04:47
|
|
apply: check allocation properly
|
|
531be3e8
|
2016-07-14T22:59:37
|
|
apply: compare preimage to image
Compare the preimage to the image; don't compare the preimage to itself.
|
|
e02f5676
|
2016-07-15T12:43:57
|
|
repo::open: remove dead code, free buffers
|
|
378d12ac
|
2016-07-24T15:47:58
|
|
Merge pull request #3868 from libgit2/ethomson/mac_build
ci: point to the homebrew libssh2 install
|
|
0239eff3
|
2016-07-24T14:51:28
|
|
ci: install homebrew's curl on mac
|
|
8b2ad593
|
2016-07-23T11:55:43
|
|
Make comment conform to style guide
Style guide says // style comments should be avoided.
|
|
877282ea
|
2016-07-23T11:47:59
|
|
Fix outdated comment
SSH transport seems to be supported now.
|
|
08556e6d
|
2016-07-22T17:45:03
|
|
ci: install homebrew's zlib on mac
|
|
d81cb2e4
|
2016-07-15T13:32:23
|
|
remote: Handle missing config values when deleting a remote
Somehow I ended up with the following in my ~/.gitconfig:
[branch "master"]
remote = origin
merge = master
rebase = true
I assume something went crazy while I was running the git.git tests
some time ago, and that I never noticed until now.
This is not a good configuration, but it shouldn't cause problems. But
it does. Specifically, if you have this in your config, and you
perform the following set of actions:
create a remote
fetch from that remote
create a branch off of the remote master branch called "master"
delete the branch
delete the remote
The remote delete fails with the message "Could not find key
'branch.master.rebase' to delete". This is because it's iterating over
the config entries (including the ones in the global config) and
believes that there is a master branch which must therefore have these
config keys.
https://github.com/libgit2/libgit2/issues/3856
|
|
bdec62dc
|
2016-07-06T13:06:25
|
|
remove conditions that prevent use of custom TLS stream
|
|
c18a2bc4
|
2016-07-05T15:51:01
|
|
Merge pull request #3851 from txdv/get-user-agent
Add get user agent functionality.
|
|
b57c176a
|
2016-07-05T12:46:27
|
|
Merge pull request #3846 from rkrp/fix_bug_parsing_int64min
Fixed bug while parsing INT64_MIN
|
|
f1dba144
|
2016-07-05T09:41:51
|
|
Add get user agent functionality.
|
|
d8243465
|
2016-07-01T18:47:06
|
|
Merge pull request #3836 from joshtriplett/cleanup-find_repo
find_repo: Clean up and simplify logic
|
|
ebeb56f0
|
2016-07-01T18:45:10
|
|
Merge pull request #3711 from joshtriplett/git_repository_discover_default
Add GIT_REPOSITORY_OPEN_FROM_ENV flag to respect $GIT_* environment vars
|
|
2b80260e
|
2016-06-30T08:08:36
|
|
CHANGELOG.md: Document new flags for git_repository_open_ext
Document GIT_REPOSITORY_OPEN_NO_DOTGIT and GIT_REPOSITORY_OPEN_FROM_ENV.
|
|
04d6ab6c
|
2016-06-30T08:08:06
|
|
CHANGELOG.md: Document behavior change in repository discovery
|
|
e4218450
|
2016-06-30T10:20:32
|
|
Merge pull request #3847 from libgit2/ethomson/read_index_conflicts
Include conflicts in `git_index_read_index`
|
|
6249d960
|
2016-06-29T17:55:44
|
|
index: include conflicts in `git_index_read_index`
Ensure that we include conflicts when calling `git_index_read_index`,
which will remove conflicts in the index that do not exist in the new
target, and will add conflicts from the new target.
|
|
6f7ec728
|
2016-06-29T17:01:47
|
|
index: refactor common `read_index` functionality
Most of `git_index_read_index` is common to reading any iterator.
Refactor it out in case we want to implement `read_tree` in terms of it
in the future.
|
|
59a0005d
|
2016-06-29T10:01:26
|
|
Merge pull request #3813 from stinb/submodule-update-fetch
submodule: Try to fetch when update fails to find the target commit.
|
|
d88e5001
|
2016-06-29T09:35:56
|
|
Merge pull request #3842 from pks-t/pks/double-free
blame: increment reference count for origin's commit
|
|
21766702
|
2016-06-27T15:20:20
|
|
blame: do not decrement commit refcount in make_origin
When we create a blame origin, we try to look up the blob that is
to be blamed at a certain revision. When this lookup fails, e.g.
because the file did not exist at that certain revision, we fail
to create the blame origin and return `NULL`. The blame origin
that we have just allocated is thereby free'd with
`origin_decref`.
The `origin_decref` function does not only decrement reference
counts for the blame origin, though, but also for its commit and
blob. When this is done in the error case, we will cause an
uneven reference count for these objects. This may result in
hard-to-debug failures at seemingly unrelated code paths, where
we try to access these objects when they in fact have already
been free'd.
Fix the issue by refactoring `make_origin` such that we only
allocate the object after the only function that may fail so that
we do not have to call `origin_decref` at all. Also fix the
`pass_blame` function, which indirectly calls `make_origin`, to
free the commit when `make_origin` failed.
|
|
70b9b841
|
2016-06-28T20:19:52
|
|
Fixed bug while parsing INT64_MIN
|
|
de43efcf
|
2016-06-28T16:07:25
|
|
submodule: Try to fetch when update fails to find the target commit in the submodule.
|
|
20302aa4
|
2016-06-25T23:33:05
|
|
Merge pull request #3223 from ethomson/apply
Reading patch files
|
|
8774c47e
|
2016-06-25T23:20:43
|
|
Merge pull request #3831 from libgit2/ethomson/readme
Improve the README
|
|
1a79cd95
|
2016-04-26T01:18:01
|
|
patch: show copy information for identical copies
When showing copy information because we are duplicating contents,
for example, when performing a `diff --find-copies-harder -M100 -B100`,
then show copy from/to lines in a patch, and do not show context.
Ensure that we can also parse such patches.
|
|
9eb19381
|
2016-04-25T22:35:55
|
|
patch::parse: test diff with exact rename and copy
|
|
8a670dc4
|
2016-04-25T18:08:03
|
|
patch::parse: test diff with simple rename
|
|
38a347ea
|
2016-04-25T17:52:39
|
|
patch::parse: handle patches with no hunks
Patches may have no hunks when there's no modifications (for example,
in a rename). Handle them.
|
|
e774d5af
|
2016-04-25T16:47:48
|
|
diff::parse tests: test parsing a diff
Test that we can create a diff file, then parse the results and
that the two are identical in-memory.
|
|
2b490284
|
2016-06-24T15:59:37
|
|
find_repo: Clean up and simplify logic
find_repo had a complex loop and heavily nested conditionals, making it
difficult to follow. Simplify this as much as possible:
- Separate assignments from conditionals.
- Check the complex loop condition in the only place it can change.
- Break out of the loop on error, rather than going through the rest of
the loop body first.
- Handle error cases by immediately breaking, rather than nesting
conditionals.
- Free repo_link unconditionally on the way out of the function, rather
than in multiple places.
- Add more comments on the remaining complex steps.
|
|
0dd98b69
|
2016-04-03T17:22:07
|
|
Add GIT_REPOSITORY_OPEN_FROM_ENV flag to respect $GIT_* environment vars
git_repository_open_ext provides parameters for the start path, whether
to search across filesystems, and what ceiling directories to stop at.
git commands have standard environment variables and defaults for each
of those, as well as various other parameters of the repository. To
avoid duplicate environment variable handling in users of libgit2, add a
GIT_REPOSITORY_OPEN_FROM_ENV flag, which makes git_repository_open_ext
automatically handle the appropriate environment variables. Commands
that intend to act just like those built into git itself can use this
flag to get the expected default behavior.
git_repository_open_ext with the GIT_REPOSITORY_OPEN_FROM_ENV flag
respects $GIT_DIR, $GIT_DISCOVERY_ACROSS_FILESYSTEM,
$GIT_CEILING_DIRECTORIES, $GIT_INDEX_FILE, $GIT_NAMESPACE,
$GIT_OBJECT_DIRECTORY, and $GIT_ALTERNATE_OBJECT_DIRECTORIES. In the
future, when libgit2 gets worktree support, git_repository_open_env will
also respect $GIT_WORK_TREE and $GIT_COMMON_DIR; until then,
git_repository_open_ext with this flag will error out if either
$GIT_WORK_TREE or $GIT_COMMON_DIR is set.
|
|
39c6fca3
|
2016-04-03T16:01:01
|
|
Add GIT_REPOSITORY_OPEN_NO_DOTGIT flag to avoid appending /.git
GIT_REPOSITORY_OPEN_NO_SEARCH does not search up through parent
directories, but still tries the specified path both directly and with
/.git appended. GIT_REPOSITORY_OPEN_BARE avoids appending /.git, but
opens the repository in bare mode even if it has a working directory.
To support the semantics git uses when given $GIT_DIR in the
environment, provide a new GIT_REPOSITORY_OPEN_NO_DOTGIT flag to not try
appending /.git.
|
|
ed577134
|
2016-04-03T19:24:15
|
|
Fix repository discovery with ceiling_dirs at current directory
git only checks ceiling directories when its search ascends to a parent
directory. A ceiling directory matching the starting directory will not
prevent git from finding a repository in the starting directory or a
parent directory. libgit2 handled the former case correctly, but
differed from git in the latter case: given a ceiling directory matching
the starting directory, but no repository at the starting directory,
libgit2 would stop the search at that point rather than finding a
repository in a parent directory.
Test case using git command-line tools:
/tmp$ git init x
Initialized empty Git repository in /tmp/x/.git/
/tmp$ cd x/
/tmp/x$ mkdir subdir
/tmp/x$ cd subdir/
/tmp/x/subdir$ GIT_CEILING_DIRECTORIES=/tmp/x git rev-parse --git-dir
fatal: Not a git repository (or any of the parent directories): .git
/tmp/x/subdir$ GIT_CEILING_DIRECTORIES=/tmp/x/subdir git rev-parse --git-dir
/tmp/x/.git
Fix the testsuite to test this case (in one case fixing a test that
depended on the current behavior), and then fix find_repo to handle this
case correctly.
In the process, simplify and document the logic in find_repo():
- Separate the concepts of "currently checking a .git directory" and
"number of iterations left before going further counts as a search"
into two separate variables, in_dot_git and min_iterations.
- Move the logic to handle in_dot_git and append /.git to the top of the
loop.
- Only search ceiling_dirs and find ceiling_offset after running out of
min_iterations; since ceiling_offset only tracks the longest matching
ceiling directory, if ceiling_dirs contained both the current
directory and a parent directory, this change makes find_repo stop the
search at the parent directory.
|
|
37e92782
|
2016-06-21T13:26:29
|
|
Merge pull request #3834 from pks-t/pks/cleanups
Cleanups
|
|
6944fd32
|
2016-06-21T13:23:04
|
|
Merge pull request #3833 from pks-t/pks/msys-conditional-fpic
cmake: do not use -fPIC for MSYS2
|
|
fe345c73
|
2016-02-09T12:29:31
|
|
Remove unused static functions
|
|
8fd74c08
|
2016-02-09T12:18:28
|
|
Avoid old-style function definitions
Avoid declaring old-style functions without any parameters.
Functions not accepting any parameters should be declared with
`void fn(void)`. See ISO C89 $3.5.4.3.
|
|
b6a2fd0e
|
2016-06-20T11:09:49
|
|
cmake: do not use -fPIC for MSYS2
The MSYS2 build system automatically compiles all code with position-independent
code. When we manually add the -fPIC flag to the compiler flags, MSYS2 will
loudly complain about PIC being the default and thus not required.
Fix the annoyance by stripping -fPIC in MSYS2 enviroments like it is already
done for MinGW.
|
|
bb0edf87
|
2016-06-20T22:50:46
|
|
Merge pull request #3830 from pks-t/pks/thread-namespacing
Thread namespacing
|
|
2976dcf8
|
2016-06-20T15:05:02
|
|
README: update "Getting Help" section
|
|
738ca6ee
|
2016-06-20T14:30:33
|
|
README: update bindings
Drop node-gitteh. Replace outdated PowerShell bindings with PSGit.
|
|
0820d0c8
|
2016-06-20T14:24:17
|
|
README: improve contributing paragraph
|
|
69d11971
|
2016-06-20T14:16:50
|
|
README: disambiguate what to distribute source of
Indicate that if you make changes to libgit2 that you must distribute
the source _to libgit2_, not the source _of your program_.
|
|
aab266c9
|
2016-06-20T20:07:33
|
|
threads: add platform-independent thread initialization function
|
|
8aaa9fb6
|
2016-06-20T18:21:42
|
|
win32: rename pthread.{c,h} to thread.{c,h}
The old pthread-file did re-implement the pthreads API with exact symbol
matching. As the thread-abstraction has now been split up between Unix- and
Windows-specific files within the `git_` namespace to avoid symbol-clashes
between libgit2 and pthreads, the rewritten wrappers have nothing to do with
pthreads anymore.
Rename the Windows-specific pthread-files to honor this change.
|
|
a342e870
|
2016-06-20T18:28:00
|
|
threads: remove now-useless typedefs
|
|
4f10c1e6
|
2016-06-20T19:40:45
|
|
threads: remove unused function pthread_num_processors_np
The function pthread_num_processors_np is currently unused and superseded by the
function `git_online_cpus`. Remove the function.
|
|
6551004f
|
2016-06-20T17:49:47
|
|
threads: split up OS-dependent rwlock code
|
|
139bffa0
|
2016-06-20T17:20:13
|
|
threads: split up OS-dependent thread-condition code
|
|
20d078df
|
2016-06-20T19:48:19
|
|
threads: remove unused function pthread_cond_broadcast
|
|
1c135405
|
2016-06-20T17:07:14
|
|
threads: split up OS-dependent mutex code
|
|
faebc1c6
|
2016-06-20T17:44:04
|
|
threads: split up OS-dependent thread code
|
|
c80efb5f
|
2016-06-20T11:16:49
|
|
Merge pull request #3818 from meatcoder/fix_odb_read_error
Fix truncation of SHA in error message for git_odb_read
|