Commit Graph

8965 Commits

Author SHA1 Message Date
Edward Thomson
f4b0267122 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.
2015-11-04 16:53:41 -05:00
Edward Thomson
790012ce78 submodule: test updating a submodule w/ a path
Test that `git_submodule_update` can handle a submodule that is
freshly cloned and has a path differing from its name.
2015-11-04 16:53:41 -05:00
Edward Thomson
5aa28a8f2d Merge pull request #3465 from libgit2/cmn/tls-register
stream: allow registering a user-provided TLS constructor
2015-11-04 14:16:24 -05:00
Edward Thomson
610e553f5b Merge branch 'pr/3487' 2015-11-03 17:52:21 -05:00
Stjepan Rajko
f5f96a23ee Fix git_commit_summary to convert newlines to spaces even after
whitespace.  Collapse spaces around newlines for the summary.
2015-11-03 17:50:55 -05:00
Edward Thomson
ec50b23acc 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.
2015-11-03 17:16:51 -05:00
Edward Thomson
2d556f3166 reflog: test reflog is deleted when ref is deleted 2015-11-03 14:48:31 -05:00
Edward Thomson
6cc5023bfd index: test that add_bypath preserves symlinks
Test that on platforms without `core.symlinks`, we preserve symlinks
in `git_index_add_bypath`.  (Users should correct the actual index
entry's mode to change a link to a regular file.)
2015-11-03 12:07:03 -05:00
Edward Thomson
6b0fc6abc1 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.
2015-11-03 12:06:49 -05:00
Edward Thomson
f20480ab0c diff: test "symlinks" in wd are respected on win32
When `core.symlinks = false`, we write the symlinks content (target)
to a regular file.  We should ensure that when we later see that
regular file, we treat it specially - and that changing that regular
file would actually change the symlink target.  (For compatibility
with Git for Windows).
2015-11-03 12:06:43 -05:00
Carlos Martín Nieto
3ce6cd4bdc Merge pull request #3494 from leoyanggit/fix_unit_test_build
Fix build for unit test
2015-11-03 08:13:41 -08:00
Carlos Martín Nieto
7fafde6325 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.
2015-11-03 08:10:29 -08:00
Carlos Martín Nieto
d39f643a0a stream: accept NULL in the free function 2015-11-03 08:10:14 -08:00
Edward Thomson
d07c9f4d2a Merge branch 'pr/3147' 2015-11-02 16:36:28 -05:00
Jason Haslam
3138ad9366 Add diff progress callback. 2015-11-02 16:33:58 -05:00
Leo Yang
505e4531b7 Fix build for unit test
If none of GIT_OPENSSL, GIT_WINHTTP or GIT_SECURE_TRANSPORT
is defined we should also be able to build the unit test.
2015-11-02 16:19:25 -05:00
Edward Thomson
db1edf91e9 Merge pull request #3491 from libgit2/cmn/config-checksum
Use checksums to detect config file changes
2015-11-02 15:09:19 -05:00
Edward Thomson
76319fa8c6 Merge pull request #3495 from leoyanggit/fix_transport_build
Fix build for custom transport users
2015-11-02 15:04:26 -05:00
Vicent Marti
1318ec91a1 Merge pull request #3492 from libgit2/vmg/redundant
merge-base: Remove redundant merge bases
2015-11-02 14:27:10 +01:00
Vicent Marti
b656e5eb4f merge: Fix memory leak in test 2015-11-02 13:47:04 +01:00
Vicent Marti
85196232e8 Add test case 2015-11-02 13:47:04 +01:00
Vicent Marti
1d0bed9de1 merge-base: Style 2015-11-02 13:47:04 +01:00
Vicent Marti
4cacf5b594 merge-base: Do not read parents from the root 2015-11-02 13:47:04 +01:00
Vicent Marti
136a71f4ee merge-base: Remove redundant merge bases 2015-11-02 13:47:04 +01:00
Carlos Martín Nieto
3547b122b5 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.
2015-10-30 21:36:51 +01:00
Carlos Martín Nieto
eb5977991a filebuf: use a checksum to detect file changes
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.
2015-10-30 19:49:35 +01:00
Carlos Martín Nieto
a2f96479ab config: add failing test for an external modification
We currently use the timestamp in order to decide whether a config file
has changed since we last read it.

This scheme falls down if the file is written twice within the same
second, as we fail to detect the file change after the first read in
that second.
2015-10-30 19:49:34 +01:00
Carlos Martín Nieto
d571a54e60 Merge pull request #3493 from ethomson/read_index
index: read_index must update hashes
2015-10-30 19:36:16 +01:00
Leo Yang
bf28da4718 Fix build for custom transport users
We should explicitly include the declaration of git_strarray
from "include/git2/sys/transport.h"
2015-10-30 14:17:11 -04:00
Carlos Martín Nieto
e0be1d605f git: put NULL check at the top 2015-10-30 18:23:17 +01:00
Edward Thomson
0bf77e3283 index: read_index must update hashes 2015-10-30 13:07:51 -04:00
Carlos Martín Nieto
45d295e08c git: accept NULL as argument to its stream free 2015-10-30 17:51:50 +01:00
Carlos Martín Nieto
fd74bd0842 Merge pull request #3486 from srajko/reflog-segfault-fix
Fix segfault when reading reflog with extra newlines
2015-10-29 20:37:48 +01:00
Stjepan Rajko
335c9e2f45 Prevent segfault when parsing a reflog with oid parse error
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
2015-10-29 11:15:37 -07:00
Edward Thomson
1b4449b40d pool: fix documentation 2015-10-28 10:53:03 -04:00
Vicent Marti
232a7e3205 Merge pull request #3488 from libgit2/vmg/pool
pool: Simplify implementation
2015-10-28 15:34:16 +01:00
Vicent Marti
d845abe639 merge: Do not mallocz unecessary entries 2015-10-28 14:49:28 +01:00
Vicent Marti
340b15b71c pool: update comment 2015-10-28 14:31:09 +01:00
Vicent Marti
d3416dfe29 pool: Dot not assume mallocs are zeroed out 2015-10-28 10:50:25 +01:00
Vicent Marti
66eb7660a8 pool: Handle 32 bit systems 2015-10-28 10:29:00 +01:00
Vicent Marti
410efda80b pool: Take into account malloc overhead & pool page size 2015-10-28 10:28:43 +01:00
Vicent Marti
4f971852d5 repository: plug memory leak
cc @carlosmn
2015-10-28 10:15:24 +01:00
Vicent Marti
1e5e02b4f4 pool: Simplify implementation 2015-10-28 10:13:13 +01:00
Vicent Marti
efc659b071 Merge pull request #3489 from libgit2/vmg/reuc-insert
Better REUC generation when merging
2015-10-28 09:55:20 +01:00
Vicent Marti
7a02e93e02 merge: Plug memory leak 2015-10-27 22:44:26 +01:00
Vicent Marti
a1f5d691a2 merge: Implement GIT_MERGE_TREE_SKIP_REUC 2015-10-27 22:44:26 +01:00
Vicent Marti
d307a0134b reuc: Be smarter when inserting new REUC entries
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.
2015-10-27 22:44:13 +01:00
Carlos Martín Nieto
2382d1bc62 Merge pull request #3485 from srajko/giterr_clear-typo-fix
Fix docs typo geterr_clear -> giterr_clear
2015-10-26 21:13:54 +01:00
Stjepan Rajko
2b96b6ef0c Fix docs typo geterr_clear -> giterr_clear 2015-10-26 10:21:09 -07:00
Edward Thomson
821131fdae Merge pull request #3477 from linquize/inttypes.h
inttypes.h is built-in header file since MSVC 2013
2015-10-23 10:13:14 -05:00