]> git.proxmox.com Git - libgit2.git/log
libgit2.git
8 years agoMerge pull request #3539 from libgit2/typedef-submodule-cb
Carlos Martín Nieto [Tue, 8 Dec 2015 20:11:58 +0000 (21:11 +0100)]
Merge pull request #3539 from libgit2/typedef-submodule-cb

Use a typedef for the submodule_foreach callback.

8 years agoMerge pull request #3537 from libgit2/cmn/tree-is-sorted
Edward Thomson [Tue, 8 Dec 2015 18:12:27 +0000 (13:12 -0500)]
Merge pull request #3537 from libgit2/cmn/tree-is-sorted

tree: mark a tree as already sorted

8 years agoPlay nice with the docs.
joshaber [Tue, 8 Dec 2015 16:58:19 +0000 (11:58 -0500)]
Play nice with the docs.

8 years agoUse a typedef for the submodule_foreach callback.
joshaber [Tue, 8 Dec 2015 16:34:00 +0000 (11:34 -0500)]
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.

8 years agotree: mark a tree as already sorted
Carlos Martín Nieto [Sun, 6 Dec 2015 21:51:00 +0000 (22:51 +0100)]
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.

8 years agoMerge pull request #3526 from sschuberth/cmake-number-compare
Carlos Martín Nieto [Sun, 6 Dec 2015 17:11:54 +0000 (18:11 +0100)]
Merge pull request #3526 from sschuberth/cmake-number-compare

CMakeLists: Compare CMAKE_SIZEOF_VOID_P as a number, not as a string

8 years agoMerge pull request #3529 from mgorny/fix-checkout-test-umask
Carlos Martín Nieto [Sun, 6 Dec 2015 17:11:37 +0000 (18:11 +0100)]
Merge pull request #3529 from mgorny/fix-checkout-test-umask

checkout test: Apply umask to file-mode test as well

8 years agoMerge pull request #3530 from libgit2/cmn/parse-mode
Edward Thomson [Thu, 3 Dec 2015 22:42:52 +0000 (17:42 -0500)]
Merge pull request #3530 from libgit2/cmn/parse-mode

tree: use a specialised mode parse function

8 years agoMerge pull request #3534 from ethomson/index_canonicalize_fix
Carlos Martín Nieto [Thu, 3 Dec 2015 22:37:37 +0000 (23:37 +0100)]
Merge pull request #3534 from ethomson/index_canonicalize_fix

index: canonicalize inserted paths safely

8 years agoindex: canonicalize inserted paths safely
Edward Thomson [Thu, 3 Dec 2015 21:27:15 +0000 (16:27 -0500)]
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.

8 years agotree: use a specialised mode parse function
Carlos Martín Nieto [Wed, 2 Dec 2015 17:56:31 +0000 (18:56 +0100)]
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.

8 years agoCMakeLists: Compare CMAKE_SIZEOF_VOID_P as a number, not as a string
Sebastian Schuberth [Wed, 7 Oct 2015 08:31:07 +0000 (10:31 +0200)]
CMakeLists: Compare CMAKE_SIZEOF_VOID_P as a number, not as a string

8 years agocheckout test: Apply umask to file-mode test as well
Michał Górny [Tue, 1 Dec 2015 19:41:23 +0000 (20:41 +0100)]
checkout test: Apply umask to file-mode test as well

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>
9 years agoMerge pull request #3527 from pks-t/pks/tree-entry-memleak
Edward Thomson [Tue, 1 Dec 2015 13:45:55 +0000 (08:45 -0500)]
Merge pull request #3527 from pks-t/pks/tree-entry-memleak

tree: mark cloned tree entries as un-pooled

9 years agotree: mark cloned tree entries as un-pooled
Patrick Steinhardt [Tue, 1 Dec 2015 13:19:29 +0000 (14:19 +0100)]
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.

9 years agoMerge pull request #3508 from libgit2/cmn/tree-parse-speed
Edward Thomson [Tue, 1 Dec 2015 01:53:54 +0000 (20:53 -0500)]
Merge pull request #3508 from libgit2/cmn/tree-parse-speed

Improvements to tree parsing speed

9 years agoMerge pull request #3525 from pks-t/pks/fix-nested-struct-warning
Carlos Martín Nieto [Mon, 30 Nov 2015 19:41:54 +0000 (20:41 +0100)]
Merge pull request #3525 from pks-t/pks/fix-nested-struct-warning

Compiler warning fixes

9 years agoobject: remove unused constant OBJECT_BASE_SIZE
Patrick Steinhardt [Mon, 30 Nov 2015 17:05:27 +0000 (18:05 +0100)]
object: remove unused constant OBJECT_BASE_SIZE

9 years agotests: fix warning for nested struct initialization
Patrick Steinhardt [Mon, 30 Nov 2015 16:40:49 +0000 (17:40 +0100)]
tests: fix warning for nested struct initialization

9 years agotree: ensure the entry filename fits in 16 bits
Carlos Martín Nieto [Mon, 30 Nov 2015 16:32:18 +0000 (17:32 +0100)]
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.

9 years agoMerge pull request #3513 from ethomson/merge_recursive
Carlos Martín Nieto [Mon, 30 Nov 2015 03:49:31 +0000 (04:49 +0100)]
Merge pull request #3513 from ethomson/merge_recursive

Recursive Merge

9 years agotree: make path len uint16_t and avoid holes
Carlos Martín Nieto [Sat, 28 Nov 2015 18:18:29 +0000 (19:18 +0100)]
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).

9 years agotree: calculate the filename length once
Carlos Martín Nieto [Sat, 14 Nov 2015 23:44:02 +0000 (00:44 +0100)]
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.

9 years agotree: pool the entry memory allocations
Carlos Martín Nieto [Sat, 14 Nov 2015 22:50:06 +0000 (23:50 +0100)]
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.

9 years agotree: avoid advancing over the filename multiple times
Carlos Martín Nieto [Sat, 14 Nov 2015 22:46:21 +0000 (23:46 +0100)]
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.

9 years agorecursive merge: add a recursion limit
Edward Thomson [Sat, 21 Nov 2015 00:01:42 +0000 (19:01 -0500)]
recursive merge: add a recursion limit

9 years agomerge: handle conflicts in recursive base building
Edward Thomson [Fri, 20 Nov 2015 22:33:49 +0000 (17:33 -0500)]
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.

9 years agomerge tests: add complex recursive example
Edward Thomson [Mon, 9 Nov 2015 16:55:26 +0000 (11:55 -0500)]
merge tests: add complex recursive example

9 years agorecursive: test conflict output during recursive merge
Edward Thomson [Mon, 9 Nov 2015 13:24:47 +0000 (08:24 -0500)]
recursive: test conflict output during recursive merge

9 years agomerge tests: move expected data into own file
Edward Thomson [Mon, 9 Nov 2015 13:23:27 +0000 (08:23 -0500)]
merge tests: move expected data into own file

9 years agomerge: use annotated commits for recursion
Edward Thomson [Wed, 11 Nov 2015 05:21:26 +0000 (21:21 -0800)]
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.

9 years agomerge: merge annotated commits instead of regular commits
Edward Thomson [Mon, 9 Nov 2015 18:01:48 +0000 (13:01 -0500)]
merge: merge annotated commits instead of regular commits

9 years agomerge: octopus merge common ancestors when >2
Edward Thomson [Wed, 28 Oct 2015 15:00:55 +0000 (11:00 -0400)]
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.

9 years agomerge: add recursive test with conflicting contents
Edward Thomson [Tue, 27 Oct 2015 23:00:30 +0000 (18:00 -0500)]
merge: add recursive test with conflicting contents

9 years agomerge: compute octopus merge bases
Edward Thomson [Tue, 27 Oct 2015 19:24:51 +0000 (14:24 -0500)]
merge: compute octopus merge bases

9 years agomerge: add recursive test with three merge bases
Edward Thomson [Tue, 27 Oct 2015 19:23:35 +0000 (14:23 -0500)]
merge: add recursive test with three merge bases

9 years agomerge: improve test names in recursive merge tests
Edward Thomson [Mon, 26 Oct 2015 21:44:36 +0000 (17:44 -0400)]
merge: improve test names in recursive merge tests

9 years agomerge: add a third-level recursive merge
Edward Thomson [Mon, 26 Oct 2015 21:25:42 +0000 (17:25 -0400)]
merge: add a third-level recursive merge

9 years agomerge: add a second-level recursive merge
Edward Thomson [Mon, 26 Oct 2015 21:14:28 +0000 (17:14 -0400)]
merge: add a second-level recursive merge

9 years agomerge: build virtual base of multiple merge bases
Edward Thomson [Mon, 26 Oct 2015 14:37:58 +0000 (10:37 -0400)]
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.

9 years agomerge: add simple recursive test
Edward Thomson [Fri, 23 Oct 2015 00:20:07 +0000 (20:20 -0400)]
merge: add simple recursive test

Add a simple recursive test - where multiple ancestors exist and
creating a virtual merge base from them would prevent a conflict.

9 years agomerge: rename `git_merge_tree_flags_t` -> `git_merge_flags_t`
Edward Thomson [Thu, 22 Oct 2015 21:00:09 +0000 (17:00 -0400)]
merge: rename `git_merge_tree_flags_t` -> `git_merge_flags_t`

9 years agoMerge pull request #3523 from pks-t/memleak-fixes
Edward Thomson [Tue, 24 Nov 2015 19:30:41 +0000 (14:30 -0500)]
Merge pull request #3523 from pks-t/memleak-fixes

Memleak fixes

9 years agoMerge pull request #3520 from ethomson/checkout_nsecs
Carlos Martín Nieto [Tue, 24 Nov 2015 14:56:55 +0000 (15:56 +0100)]
Merge pull request #3520 from ethomson/checkout_nsecs

checkout: only consider nsecs when built that way

9 years agotests: win32::longpath: free expected_msg
Patrick Steinhardt [Tue, 24 Nov 2015 13:36:46 +0000 (14:36 +0100)]
tests: win32::longpath: free expected_msg

9 years agotests: config::stress: free `git_config` structs
Patrick Steinhardt [Tue, 24 Nov 2015 13:38:17 +0000 (14:38 +0100)]
tests: config::stress: free `git_config` structs

9 years agotests: config::global: fix memleak in open_programdata
Patrick Steinhardt [Tue, 24 Nov 2015 13:29:32 +0000 (14:29 +0100)]
tests: config::global: fix memleak in open_programdata

9 years agocheckout: only consider nsecs when built that way
Edward Thomson [Mon, 23 Nov 2015 20:49:54 +0000 (15:49 -0500)]
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).

9 years agoMerge pull request #3515 from jacquesg/unsigned-signed
Edward Thomson [Sat, 21 Nov 2015 16:26:18 +0000 (11:26 -0500)]
Merge pull request #3515 from jacquesg/unsigned-signed

Fix <0 unsigned comparison (stat.st_size should be an off_t)

9 years agoMake stat.st_size a __int64 not a uint64_t
Jacques Germishuys [Fri, 20 Nov 2015 18:22:38 +0000 (20:22 +0200)]
Make stat.st_size a __int64 not a uint64_t

9 years agoMerge pull request #3517 from jacquesg/warnings-fixes
Edward Thomson [Fri, 20 Nov 2015 22:57:04 +0000 (17:57 -0500)]
Merge pull request #3517 from jacquesg/warnings-fixes

Fix some warnings

9 years agoMerge pull request #3514 from jacquesg/stat-fixes
Edward Thomson [Fri, 20 Nov 2015 22:52:00 +0000 (17:52 -0500)]
Merge pull request #3514 from jacquesg/stat-fixes

Stat fixes

9 years agoMerge pull request #3516 from libgit2/cmn/repository-state-sequencer
Edward Thomson [Fri, 20 Nov 2015 20:38:33 +0000 (15:38 -0500)]
Merge pull request #3516 from libgit2/cmn/repository-state-sequencer

repository: distinguish sequencer cherry-pick and revert

9 years agoDetect stat's structure
Jacques Germishuys [Fri, 20 Nov 2015 16:57:13 +0000 (18:57 +0200)]
Detect stat's structure

9 years agoFix some warnings
Jacques Germishuys [Fri, 20 Nov 2015 18:48:51 +0000 (20:48 +0200)]
Fix some warnings

9 years agorepository: distinguish sequencer cherry-pick and revert
Carlos Martín Nieto [Fri, 20 Nov 2015 18:19:23 +0000 (13:19 -0500)]
repository: distinguish sequencer cherry-pick and revert

These are not quite like their plain counterparts and require special handling.

9 years agoMerge pull request #3511 from ethomson/racy_fixes_2
Carlos Martín Nieto [Tue, 17 Nov 2015 18:21:18 +0000 (13:21 -0500)]
Merge pull request #3511 from ethomson/racy_fixes_2

Racy fixes for writing new indexes

9 years agoMerge pull request #3512 from ethomson/windows_sysdir
Carlos Martín Nieto [Tue, 17 Nov 2015 18:20:48 +0000 (13:20 -0500)]
Merge pull request #3512 from ethomson/windows_sysdir

Protect windows SYSDIR when running tests

9 years agotests: use out-of-the-way config dir in sandbox
Edward Thomson [Tue, 17 Nov 2015 16:22:01 +0000 (11:22 -0500)]
tests: use out-of-the-way config dir in sandbox

Don't put the configuration in a subdir of the sandbox named
`config`, lest some tests decide to create their own directory
called `config`.  Prefix with some underscores for uniqueness.

9 years agotests: set PROGRAMDATA directory for running tests
Edward Thomson [Tue, 17 Nov 2015 04:34:26 +0000 (23:34 -0500)]
tests: set PROGRAMDATA directory for running tests

9 years agoconfig::global: use PROGRAMDATA configuration
Edward Thomson [Tue, 17 Nov 2015 13:38:46 +0000 (08:38 -0500)]
config::global: use PROGRAMDATA configuration

Query the `GIT_CONFIG_LEVEL_PROGRAMDATA` location when setting it up
for tests, in case the test runner has sandboxed it.

9 years agosettings: allow users to set PROGRAMDATA
Edward Thomson [Tue, 17 Nov 2015 04:31:19 +0000 (23:31 -0500)]
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.

9 years agoracy: make git_index_read_index handle raciness
Edward Thomson [Mon, 16 Nov 2015 23:06:52 +0000 (18:06 -0500)]
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.

9 years agoracy: ensure git_index_read_tree clears uptodate
Edward Thomson [Mon, 16 Nov 2015 23:05:46 +0000 (18:05 -0500)]
racy: ensure git_index_read_tree clears uptodate

Ensure that `git_index_read_tree` clears the uptodate bit on files
that it modifies.

9 years agoindex: clear uptodate bit on save
Edward Thomson [Fri, 13 Nov 2015 21:31:51 +0000 (16:31 -0500)]
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.

9 years agoindex: test for smudged entries on write only
Edward Thomson [Fri, 13 Nov 2015 21:30:39 +0000 (16:30 -0500)]
index: test for smudged entries on write only

Test that entries are only smudged when we write the index: the
entry smudging is to prevent us from updating an index in a way
that it would be impossible to tell that an item was racy.
Consider when we load an index:  any entries that have the same
(or newer) timestamp than the index itself are considered racy,
and are subject to further scrutiny.

If we *save* that index with the same entries that we loaded,
then the index would now have a newer timestamp than the entries,
and they would no longer be given that additional scrutiny, failing
our racy detection!  So test that we smudge those entries only on
writing the new index, but that we can detect them (in diff) without
having to write.

9 years agocheckout::crlf test: don't crash when no idx entry
Edward Thomson [Fri, 13 Nov 2015 20:36:45 +0000 (15:36 -0500)]
checkout::crlf test: don't crash when no idx entry

When there's no matching index entry (for whatever reason), don't
try to dereference the null return value to get at the id.

Otherwise when we break something in the index API, the checkout
test crashes for confusing reasons and causes us to step through
it in a debugger thinking that we had broken much more than we
actually did.

9 years agoindex: don't detect raciness in uptodate entries
Edward Thomson [Fri, 13 Nov 2015 20:32:48 +0000 (15:32 -0500)]
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.

9 years agoracy-git: do a single index->workdir diff
Edward Thomson [Fri, 6 Nov 2015 22:15:35 +0000 (17:15 -0500)]
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.

9 years agoMerge pull request #3506 from libgit2/vmg/pool-align
Carlos Martín Nieto [Fri, 13 Nov 2015 04:41:18 +0000 (05:41 +0100)]
Merge pull request #3506 from libgit2/vmg/pool-align

pool: Never return unaligned buffers

9 years agopool: Never return unaligned buffers
Vicent Marti [Thu, 12 Nov 2015 19:51:01 +0000 (20:51 +0100)]
pool: Never return unaligned buffers

9 years agoMerge pull request #3170 from CmdrMoozy/nsec_fix
Carlos Martín Nieto [Thu, 12 Nov 2015 18:53:09 +0000 (19:53 +0100)]
Merge pull request #3170 from CmdrMoozy/nsec_fix

git_index_entry__init_from_stat: set nsec fields in entry stats

9 years agoMerge pull request #3499 from ethomson/ref_dir_errmsgs
Carlos Martín Nieto [Thu, 12 Nov 2015 18:22:31 +0000 (19:22 +0100)]
Merge pull request #3499 from ethomson/ref_dir_errmsgs

Improve error messages when dirs prevent ref/reflog creation

9 years agoMerge pull request #3448 from libgit2/cmn/custom-agent
Carlos Martín Nieto [Thu, 12 Nov 2015 18:20:36 +0000 (19:20 +0100)]
Merge pull request #3448 from libgit2/cmn/custom-agent

Support setting custom user-agent

9 years agoCHANGELOG: add note about custom user-agent
Carlos Martín Nieto [Thu, 12 Nov 2015 16:20:30 +0000 (17:20 +0100)]
CHANGELOG: add note about custom user-agent

9 years agowinhttp: use a custom user-agent if the user has set it
Carlos Martín Nieto [Fri, 2 Oct 2015 01:57:14 +0000 (03:57 +0200)]
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.

9 years agohttp: use a custom user-agent if the user has set it
Carlos Martín Nieto [Fri, 2 Oct 2015 01:46:34 +0000 (03:46 +0200)]
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.

9 years agosettings: add a setter for a custom user-agent
Carlos Martín Nieto [Fri, 2 Oct 2015 01:43:11 +0000 (03:43 +0200)]
settings: add a setter for a custom user-agent

9 years agoMerge pull request #2534 from libgit2/ntk/case_index_conflicts
Edward Thomson [Thu, 12 Nov 2015 15:13:11 +0000 (10:13 -0500)]
Merge pull request #2534 from libgit2/ntk/case_index_conflicts

Failing test for case sensitive conflicts in the index

9 years agoreflog: error when a directory is at reflog path
Edward Thomson [Tue, 3 Nov 2015 22:34:54 +0000 (17:34 -0500)]
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.

9 years agorefs: complain when a directory exists at ref
Edward Thomson [Tue, 3 Nov 2015 22:18:00 +0000 (17:18 -0500)]
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.

9 years agoindex: overwrite the path when inserting conflicts
Carlos Martín Nieto [Thu, 12 Nov 2015 10:54:06 +0000 (11:54 +0100)]
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.

9 years agoindex: correctly report which conflict stage has a wrong filemode
Carlos Martín Nieto [Tue, 10 Nov 2015 23:36:15 +0000 (00:36 +0100)]
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.

9 years agoFailing test for case sensitive conflicts in the index
nulltoken [Tue, 26 Aug 2014 11:51:37 +0000 (13:51 +0200)]
Failing test for case sensitive conflicts in the index

9 years agoMerge pull request #3498 from ethomson/windows_symlinks
Carlos Martín Nieto [Sun, 8 Nov 2015 04:10:18 +0000 (05:10 +0100)]
Merge pull request #3498 from ethomson/windows_symlinks

Diff: Honor `core.symlinks=false` and fake symlinks

9 years agoMerge pull request #3500 from ethomson/submodules_with_path
Carlos Martín Nieto [Sun, 8 Nov 2015 03:54:55 +0000 (04:54 +0100)]
Merge pull request #3500 from ethomson/submodules_with_path

Handle submodules with paths in `git_submodule_update`

9 years agosubmodule: reload HEAD/index after reading config
Edward Thomson [Wed, 4 Nov 2015 21:17:51 +0000 (16:17 -0500)]
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.

9 years agosubmodule: test updating a submodule w/ a path
Edward Thomson [Wed, 4 Nov 2015 21:16:51 +0000 (16:16 -0500)]
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.

9 years agoMerge pull request #3465 from libgit2/cmn/tls-register
Edward Thomson [Wed, 4 Nov 2015 19:16:24 +0000 (14:16 -0500)]
Merge pull request #3465 from libgit2/cmn/tls-register

stream: allow registering a user-provided TLS constructor

9 years agoMerge branch 'pr/3487'
Edward Thomson [Tue, 3 Nov 2015 22:52:21 +0000 (17:52 -0500)]
Merge branch 'pr/3487'

9 years agoFix git_commit_summary to convert newlines to spaces even after
Stjepan Rajko [Fri, 9 Oct 2015 17:41:06 +0000 (10:41 -0700)]
Fix git_commit_summary to convert newlines to spaces even after
whitespace.  Collapse spaces around newlines for the summary.

9 years agofilebuf: detect directories in our way
Edward Thomson [Tue, 3 Nov 2015 22:02:07 +0000 (17:02 -0500)]
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.

9 years agoreflog: test reflog is deleted when ref is deleted
Edward Thomson [Tue, 3 Nov 2015 19:48:31 +0000 (14:48 -0500)]
reflog: test reflog is deleted when ref is deleted

9 years agoindex: test that add_bypath preserves symlinks
Edward Thomson [Tue, 3 Nov 2015 16:27:31 +0000 (11:27 -0500)]
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.)

9 years agodiff: on win32, treat fake "symlinks" specially
Edward Thomson [Tue, 3 Nov 2015 14:43:18 +0000 (09:43 -0500)]
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.

9 years agodiff: test "symlinks" in wd are respected on win32
Edward Thomson [Tue, 3 Nov 2015 14:40:30 +0000 (09:40 -0500)]
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).

9 years agoMerge pull request #3494 from leoyanggit/fix_unit_test_build
Carlos Martín Nieto [Tue, 3 Nov 2015 16:13:41 +0000 (08:13 -0800)]
Merge pull request #3494 from leoyanggit/fix_unit_test_build

Fix build for unit test

9 years agostream: allow registering a user-provided TLS constructor
Carlos Martín Nieto [Tue, 13 Oct 2015 09:25:41 +0000 (11:25 +0200)]
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.

9 years agostream: accept NULL in the free function
Carlos Martín Nieto [Tue, 13 Oct 2015 17:34:07 +0000 (19:34 +0200)]
stream: accept NULL in the free function

9 years agoMerge branch 'pr/3147'
Edward Thomson [Mon, 2 Nov 2015 21:36:28 +0000 (16:36 -0500)]
Merge branch 'pr/3147'