]> git.proxmox.com Git - libgit2.git/log
libgit2.git
9 years ago`mkdir`: cope with root path on win32
Edward Thomson [Thu, 17 Sep 2015 16:48:37 +0000 (12:48 -0400)]
`mkdir`: cope with root path on win32

9 years agowin32: return EACCES in `p_lstat`
Edward Thomson [Thu, 17 Sep 2015 16:23:19 +0000 (12:23 -0400)]
win32: return EACCES in `p_lstat`

Don't coalesce all errors into ENOENT.  At least identify EACCES.
All callers should be handling this case already, as the POSIX
`lstat` will return this.

9 years agomkdir: chmod existing paths with `GIT_MKDIR_CHMOD`
Edward Thomson [Thu, 17 Sep 2015 15:26:38 +0000 (11:26 -0400)]
mkdir: chmod existing paths with `GIT_MKDIR_CHMOD`

9 years agomkdir: find component paths for mkdir_relative
Edward Thomson [Thu, 17 Sep 2015 13:42:05 +0000 (09:42 -0400)]
mkdir: find component paths for mkdir_relative

`git_futils_mkdir` does not blindly call `git_futils_mkdir_relative`.

`git_futils_mkdir_relative` is used when you have some base directory
and want to create some path inside of it, potentially removing blocking
symlinks and files in the process.  This is not suitable for a general
recursive mkdir within the filesystem.

Instead, when `mkdir` is being recursive, locate the first existent
parent directory and use that as the base for `mkdir_relative`.

9 years agocore::mkdir tests: ensure we don't stomp symlinks in mkdir
Edward Thomson [Thu, 17 Sep 2015 13:58:38 +0000 (09:58 -0400)]
core::mkdir tests: ensure we don't stomp symlinks in mkdir

In `mkdir` and `mkdir_r`, ensure that we don't try to remove symlinks
that are in our way.

9 years agocore::mkdir tests: include absolute mkdirs
Edward Thomson [Wed, 16 Sep 2015 22:07:56 +0000 (18:07 -0400)]
core::mkdir tests: include absolute mkdirs

9 years agogit_futils_mkdir_*: make a relative-to-base mkdir
Edward Thomson [Wed, 16 Sep 2015 19:07:27 +0000 (15:07 -0400)]
git_futils_mkdir_*: make a relative-to-base mkdir

Untangle git_futils_mkdir from git_futils_mkdir_ext - the latter
assumes that we own everything beneath the base, as if it were
being called with a base of the repository or working directory,
and is tailored towards checkout and ensuring that there is no
bogosity beneath the base that must be cleaned up.

This is (at best) slow and (at worst) unsafe in the larger context
of a filesystem where we do not own things and cannot do things like
unlink symlinks that are in our way.

9 years agoMerge pull request #3429 from ethomson/checkout_chmod
Carlos Martín Nieto [Wed, 16 Sep 2015 15:46:24 +0000 (17:46 +0200)]
Merge pull request #3429 from ethomson/checkout_chmod

Checkout: handle mode changes

9 years agocheckout: overwrite files with differing modes
Edward Thomson [Wed, 16 Sep 2015 05:44:27 +0000 (05:44 +0000)]
checkout: overwrite files with differing modes

When a file exists on disk and we're checking out a file that differs
in executableness, remove the old file.  This allows us to recreate the
new file with p_open, which will take the new mode into account and
handle setting the umask properly.

Remove any notion of chmod'ing existing files, since it is now handled
by the aforementioned removal and was incorrect, as it did not take
umask into account.

9 years agocheckout::tree tests: don't use hardcoded mode
Edward Thomson [Wed, 16 Sep 2015 14:17:54 +0000 (10:17 -0400)]
checkout::tree tests: don't use hardcoded mode

9 years agocheckout::tree tests: don't use static buffer
Edward Thomson [Wed, 16 Sep 2015 04:12:47 +0000 (04:12 +0000)]
checkout::tree tests: don't use static buffer

9 years agoCheck that checkout preserves filemode in working directory.
Matti Virolainen [Mon, 1 Jun 2015 11:31:49 +0000 (14:31 +0300)]
Check that checkout preserves filemode in working directory.

9 years agoCheck that an executable in index is not an executable after checkout.
Matti Virolainen [Mon, 1 Jun 2015 08:16:36 +0000 (11:16 +0300)]
Check that an executable in index is not an executable after checkout.

9 years agoMerge pull request #3428 from ethomson/clone_test_buffer
Edward Thomson [Mon, 14 Sep 2015 18:58:54 +0000 (14:58 -0400)]
Merge pull request #3428 from ethomson/clone_test_buffer

Clone test buffer

9 years agocl_git_path_url: assert sane static buffer size
Edward Thomson [Mon, 14 Sep 2015 18:05:01 +0000 (14:05 -0400)]
cl_git_path_url: assert sane static buffer size

9 years agoclone::nonetwork: don't use fixed size buffer
Edward Thomson [Mon, 14 Sep 2015 17:58:38 +0000 (13:58 -0400)]
clone::nonetwork: don't use fixed size buffer

9 years agoMerge pull request #3425 from ethomson/diriter_root
Carlos Martín Nieto [Sun, 13 Sep 2015 21:21:14 +0000 (23:21 +0200)]
Merge pull request #3425 from ethomson/diriter_root

Handle `git_path_diriter` instances at the drive root on Windows

9 years agoMerge pull request #3426 from ethomson/fs_iterator
Carlos Martín Nieto [Sun, 13 Sep 2015 20:31:08 +0000 (22:31 +0200)]
Merge pull request #3426 from ethomson/fs_iterator

iterator: loop fs_iterator advance (don't recurse)

9 years agodiriter: don't double '/' on posix
Edward Thomson [Sun, 13 Sep 2015 18:18:08 +0000 (14:18 -0400)]
diriter: don't double '/' on posix

The canonical directory path of the root directory of a volume on
POSIX already ends in a slash (eg, `/`).  This is true only at the
root.  Do not add a slash to paths in this case.

9 years agoiterator: loop fs_iterator advance (don't recurse)
Edward Thomson [Fri, 11 Sep 2015 22:27:04 +0000 (18:27 -0400)]
iterator: loop fs_iterator advance (don't recurse)

9 years agodiriter: don't double '/' on Windows
Edward Thomson [Sun, 13 Sep 2015 17:59:41 +0000 (13:59 -0400)]
diriter: don't double '/' on Windows

The canonical directory path of the root directory of a volume on
windows already ends in a slash (eg, `c:/`).  This is true only
at the volume root.  Do not add a slash to paths in this case.

9 years agodiriter: test we can iterate root
Edward Thomson [Sun, 13 Sep 2015 17:52:19 +0000 (13:52 -0400)]
diriter: test we can iterate root

Ensure that we can iterate the filesystem root and that paths come
back well-formed, not with an additional '/'.  (eg, when iterating
`c:/`, expect that we do not get some path like `c://autoexec.bat`).

9 years agoMerge pull request #3423 from libgit2/cmn/push-tests-inline-oid
Carlos Martín Nieto [Sun, 13 Sep 2015 17:43:55 +0000 (19:43 +0200)]
Merge pull request #3423 from libgit2/cmn/push-tests-inline-oid

push: put the git_oid inline in the test structure

9 years agoMerge pull request #3420 from ethomson/iterator
Carlos Martín Nieto [Sun, 13 Sep 2015 17:43:39 +0000 (19:43 +0200)]
Merge pull request #3420 from ethomson/iterator

iterator: advance the tree iterator smartly

9 years agoMerge pull request #3424 from arthurschreiber/arthur/transaction-dont-free-config
Carlos Martín Nieto [Sun, 13 Sep 2015 15:33:26 +0000 (17:33 +0200)]
Merge pull request #3424 from arthurschreiber/arthur/transaction-dont-free-config

Don't free config in `git_transaction_commit`.

9 years agoDon't free config in `git_transaction_commit`.
Arthur Schreiber [Sun, 13 Sep 2015 14:32:24 +0000 (16:32 +0200)]
Don't free config in `git_transaction_commit`.

The config is not owned by the transaction, so please don’t free it.

9 years agoMerge branch 'cmn/ignore-dir-check'
Carlos Martín Nieto [Sun, 13 Sep 2015 04:21:18 +0000 (06:21 +0200)]
Merge branch 'cmn/ignore-dir-check'

9 years agoignore: add test and adjust style and comment for dir with wildmatch
Carlos Martín Nieto [Sun, 13 Sep 2015 04:18:49 +0000 (06:18 +0200)]
ignore: add test and adjust style and comment for dir with wildmatch

The previous commit left the comment referencing the earlier state of
the code, change it to explain the current logic. While here, change the
logic to avoid repeating the copy of the base pattern.

9 years agoMerge pull request #3370 from libgit2/cmn/submodule-refactor
Carlos Martín Nieto [Sun, 13 Sep 2015 04:03:12 +0000 (06:03 +0200)]
Merge pull request #3370 from libgit2/cmn/submodule-refactor

submodule: refactor to be more explicit in the search

9 years agopush: put the git_oid inline in the test structure
Carlos Martín Nieto [Sun, 13 Sep 2015 03:38:29 +0000 (05:38 +0200)]
push: put the git_oid inline in the test structure

These are small pieces of data, so there is no advantage to allocating
them separately. Include the two ids inline in the struct we use to
check that the expected and actual ids match.

9 years agoMerge pull request #3422 from ethomson/workdir_diff
Carlos Martín Nieto [Sat, 12 Sep 2015 20:49:23 +0000 (22:49 +0200)]
Merge pull request #3422 from ethomson/workdir_diff

diff: examine pathlist on non-files

9 years agodiff: check pathspec on non-files
Edward Thomson [Sat, 12 Sep 2015 19:32:18 +0000 (15:32 -0400)]
diff: check pathspec on non-files

When we're not doing pathspec matching, we let the iterator handle
file matching for us.  However, we can only trust the iterator to
return *files* that match the pattern, because the iterator must
return directories that are not strictly in the pathlist, but that
are the parents of files that match the pattern, so that diff can
later recurse into them.

Thus, diff must examine non-files explicitly before including them
in the delta list.

9 years agodiff::workdir: ensure ignored files are not returned
Edward Thomson [Sat, 12 Sep 2015 17:46:22 +0000 (13:46 -0400)]
diff::workdir: ensure ignored files are not returned

Ensure that a diff with the workdir is not erroneously returning
directories.

9 years agoMerge pull request #3421 from ethomson/mempack-fix
Carlos Martín Nieto [Sat, 12 Sep 2015 02:00:34 +0000 (04:00 +0200)]
Merge pull request #3421 from ethomson/mempack-fix

Mempack fix

9 years agomempack: expose clear function
Edward Thomson [Sat, 12 Sep 2015 00:06:14 +0000 (20:06 -0400)]
mempack: expose clear function

9 years agoRemoving memory leak in mempack's free
Bryan Woods [Fri, 11 Sep 2015 23:35:14 +0000 (16:35 -0700)]
Removing memory leak in mempack's free

It calls git_mempack_reset which reallocates the object array. git_oidmap_free is now called on it explicitly.

9 years agoiterator: advance the tree iterator smartly
Edward Thomson [Fri, 11 Sep 2015 21:38:28 +0000 (17:38 -0400)]
iterator: advance the tree iterator smartly

While advancing the tree iterator, if we advance over things that
we aren't interested in, then call `current`.  Which may *itself*
call advance.

While advancing the tree iterator, if we advance over things that
we aren't interested in, then call `current`.  Which may *itself*
call advance.

While advancing the tree iterator, if we advance over things that
we aren't interested in, then call `current`.  Which may *itself*
call advance.

While advancing the tree iterator, if we advance over things that
we aren't interested in, then call `current`.  Which may *itself*
call advance.

While advancing the tree iterator, if we advance over things that
we aren't interested in, then call `current`.  Which may *itself*
call advance.

Error: stack overflow.

9 years agoFixing dangling pointers in git_mempack_reset
Bryan Woods [Thu, 10 Sep 2015 21:44:52 +0000 (14:44 -0700)]
Fixing dangling pointers in git_mempack_reset

git_mempack_reset was leaving free'd pointers in the oidmap.

9 years agosubmodule: add a test for a renamed submdoule dir
Carlos Martín Nieto [Thu, 10 Sep 2015 19:23:03 +0000 (21:23 +0200)]
submodule: add a test for a renamed submdoule dir

9 years agosubmodule: refactor to be more explicit in the search
Carlos Martín Nieto [Mon, 10 Aug 2015 16:36:27 +0000 (18:36 +0200)]
submodule: refactor to be more explicit in the search

When searching for information about a submdoule, let's be more explicit
in what we expect to find. We currently insert a submodule into the map
and change certain parameters when the config callback gets called.

Switch to asking for the configuration we're interested in, rather than
taking it in an arbitrary order.

9 years agoMerge pull request #3379 from theseion/additional_libssh2_error_reporting
Carlos Martín Nieto [Wed, 9 Sep 2015 11:59:38 +0000 (13:59 +0200)]
Merge pull request #3379 from theseion/additional_libssh2_error_reporting

report libssh2 error if list of authentication methods can't be retrieved

9 years agoMerge pull request #3415 from ethomson/lock_hidden
Carlos Martín Nieto [Tue, 8 Sep 2015 23:37:06 +0000 (01:37 +0200)]
Merge pull request #3415 from ethomson/lock_hidden

filebuf: ensure we can lock a hidden file

9 years agofutils: ensure we can write a hidden file
Edward Thomson [Tue, 8 Sep 2015 19:48:44 +0000 (15:48 -0400)]
futils: ensure we can write a hidden file

9 years agofilebuf: ensure we can lock a hidden file
Edward Thomson [Tue, 8 Sep 2015 18:35:53 +0000 (14:35 -0400)]
filebuf: ensure we can lock a hidden file

9 years agoMerge pull request #3410 from libgit2/cmn/ssh-embed-again
Edward Thomson [Tue, 8 Sep 2015 16:43:36 +0000 (12:43 -0400)]
Merge pull request #3410 from libgit2/cmn/ssh-embed-again

Revert "Get rid of libssh2 embedding"

9 years agoMerge pull request #3353 from ethomson/wrongcase_add
Carlos Martín Nieto [Tue, 8 Sep 2015 16:34:51 +0000 (18:34 +0200)]
Merge pull request #3353 from ethomson/wrongcase_add

index: canonicalize directory case when adding

9 years agoMerge pull request #3381 from leoyanggit/index_directory_iterator
Edward Thomson [Tue, 8 Sep 2015 15:50:08 +0000 (11:50 -0400)]
Merge pull request #3381 from leoyanggit/index_directory_iterator

New feature: add the ablility to iterate through a directory in index

9 years agogit_index_add: allow case changing renames
Edward Thomson [Fri, 7 Aug 2015 17:43:49 +0000 (12:43 -0500)]
git_index_add: allow case changing renames

On case insensitive platforms, allow `git_index_add` to provide a new
path for an existing index entry.  Previously, we would maintain the
case in an index entry without the ability to change it (except by
removing an entry and re-adding it.)

Higher-level functions (like `git_index_add_bypath` and
`git_index_add_frombuffers`) continue to keep the old path for easier
usage.

9 years agoindex: canonicalize directory case when adding
Edward Thomson [Tue, 4 Aug 2015 21:51:00 +0000 (16:51 -0500)]
index: canonicalize directory case when adding

On case insensitive systems, when given a user-provided path in the
higher-level index addition functions (eg `git_index_add_bypath` /
`git_index_add_frombuffer`), examine the index to try to match the
given path to an existing directory.

Various mechanisms can cause the on-disk representation of a folder
to not match the representation in HEAD or the index - for example,
a case changing rename of some file `a/file.txt` to `A/file.txt`
will update the paths in the index, but not rename the folder on
disk.

If a user subsequently adds `a/other.txt`, then this should be stored
in the index as `A/other.txt`.

9 years agoMerge pull request #3413 from libgit2/cmn/follow-symlink
Edward Thomson [Sun, 6 Sep 2015 14:51:29 +0000 (10:51 -0400)]
Merge pull request #3413 from libgit2/cmn/follow-symlink

filebuf: follow symlinks when creating a lock file

9 years agoMerge pull request #3366 from libgit2/cmn/index-hashmap
Edward Thomson [Sun, 6 Sep 2015 14:50:22 +0000 (10:50 -0400)]
Merge pull request #3366 from libgit2/cmn/index-hashmap

Use a hashmap for path-based lookups in the index

9 years agofilebuf: follow symlinks when creating a lock file
Carlos Martín Nieto [Sat, 5 Sep 2015 01:54:06 +0000 (03:54 +0200)]
filebuf: follow symlinks when creating a lock file

We create a lockfile to update files under GIT_DIR. Sometimes these
files are actually located elsewhere and a symlink takes their place. In
that case we should lock and update the file at its final location
rather than overwrite the symlink.

9 years agoNew API: git_index_find_prefix
Leo Yang [Mon, 17 Aug 2015 19:02:02 +0000 (15:02 -0400)]
New API: git_index_find_prefix

Find the first index entry matching a prefix.

9 years agoindex: put the icase insert choice in macros
Carlos Martín Nieto [Fri, 4 Sep 2015 11:30:49 +0000 (13:30 +0200)]
index: put the icase insert choice in macros

This should let us see more clearly what we're doing and avoid the ugly
'if' we need every time we want to interact with the map.

9 years agoRevert "Get rid of libssh2 embedding"
Carlos Martín Nieto [Thu, 3 Sep 2015 11:35:15 +0000 (13:35 +0200)]
Revert "Get rid of libssh2 embedding"

The embedding was removed as a libssh2 release with Windows crypto
support became available, but dependencies are still annoying so this
ahs been requested again.

This reverts commit 20dcb7315cd4c5760c68402998fd9e5a6bf5505d.

9 years agoconfig: correct documentation for non-existent config file
Carlos Martín Nieto [Thu, 3 Sep 2015 09:38:21 +0000 (11:38 +0200)]
config: correct documentation for non-existent config file

9 years agoMerge pull request #3402 from ethomson/faster_diff
Carlos Martín Nieto [Tue, 1 Sep 2015 00:26:11 +0000 (02:26 +0200)]
Merge pull request #3402 from ethomson/faster_diff

Provide path matching in the iterators (for faster diffs)

9 years agoiterator: better document GIT_DIFF_DISABLE_PATHSPEC_MATCH
Edward Thomson [Mon, 31 Aug 2015 23:41:43 +0000 (19:41 -0400)]
iterator: better document GIT_DIFF_DISABLE_PATHSPEC_MATCH

9 years agoiterator test: handle case (in)sensitivity
Edward Thomson [Mon, 31 Aug 2015 16:12:21 +0000 (12:12 -0400)]
iterator test: handle case (in)sensitivity

9 years agoiterator test: use new iter opts in fifo test
Edward Thomson [Sun, 30 Aug 2015 23:33:18 +0000 (19:33 -0400)]
iterator test: use new iter opts in fifo test

9 years agoiterator: saner pathlist matching for idx iterator
Edward Thomson [Sun, 30 Aug 2015 23:25:47 +0000 (19:25 -0400)]
iterator: saner pathlist matching for idx iterator

Some nicer refactoring for index iteration walks.

The index iterator doesn't binary search through the pathlist space,
since it lacks directory entries, and would have to binary search
each index entry and all its parents (eg, when presented with an index
entry of `foo/bar/file.c`, you would have to look in the pathlist for
`foo/bar/file.c`, `foo/bar` and `foo`).  Since the index entries and the
pathlist are both nicely sorted, we walk the index entries in lockstep
with the pathlist like we do for other iteration/diff/merge walks.

9 years agodiff: drop `FILELIST_MATCH`
Edward Thomson [Sun, 30 Aug 2015 23:10:00 +0000 (19:10 -0400)]
diff: drop `FILELIST_MATCH`

Now that non-pathspec matching diffs are implemented at the iterator
level, drop `FILELIST_MATCH`ing.

9 years agostatus test: brackets are now literal
Edward Thomson [Sun, 30 Aug 2015 22:57:06 +0000 (18:57 -0400)]
status test: brackets are now literal

9 years agocheckout: use pathlist-based iterators
Edward Thomson [Sun, 30 Aug 2015 22:56:39 +0000 (18:56 -0400)]
checkout: use pathlist-based iterators

9 years agotree_iterator: use a pathlist
Edward Thomson [Sun, 30 Aug 2015 22:35:57 +0000 (18:35 -0400)]
tree_iterator: use a pathlist

9 years agodiff: use new iterator pathlist handling
Edward Thomson [Sun, 30 Aug 2015 21:06:26 +0000 (17:06 -0400)]
diff: use new iterator pathlist handling

When using literal pathspecs in diff with `GIT_DIFF_DISABLE_PATHSPEC_MATCH`
turn on the faster iterator pathlist handling.

Updates iterator pathspecs to include directory prefixes (eg, `foo/`)
for compatibility with `GIT_DIFF_DISABLE_PATHSPEC_MATCH`.

9 years agoMerge pull request #3401 from phatblat/pb/doc-warning
Carlos Martín Nieto [Sun, 30 Aug 2015 13:47:49 +0000 (15:47 +0200)]
Merge pull request #3401 from phatblat/pb/doc-warning

Escape @ in doc comment

9 years agoEscape @ in doc comment
Ben Chatelain [Sat, 29 Aug 2015 23:46:34 +0000 (17:46 -0600)]
Escape @ in doc comment

9 years agodiff: better document GIT_DIFF_PATHSPEC_DISABLE
Edward Thomson [Sat, 29 Aug 2015 00:06:18 +0000 (20:06 -0400)]
diff: better document GIT_DIFF_PATHSPEC_DISABLE

Document that `GIT_DIFF_PATHSPEC_DISABLE` is not necessarily about
explicit path matching, but also includes matching of directory
names.  Enforce this in a test.

9 years agoMerge pull request #3352 from ethomson/hidden
Edward Thomson [Fri, 28 Aug 2015 23:30:08 +0000 (19:30 -0400)]
Merge pull request #3352 from ethomson/hidden

win32: ensure hidden files can be staged

9 years agoiterator: sort subdirs properly with pathlist
Edward Thomson [Fri, 28 Aug 2015 22:30:39 +0000 (18:30 -0400)]
iterator: sort subdirs properly with pathlist

When given a pathlist, don't assume that directories sort before
files.  Walk through any list of entries sorting before us to make
sure that we've exhausted all entries that *aren't* directories.

Eg, if we're searching for 'foo/bar', and we have a 'foo.c', keep
advancing the pathlist to keep looking for an entry prefixed with
'foo/'.

9 years agoracy-git: TODO to use improved diffing
Edward Thomson [Wed, 29 Jul 2015 01:04:11 +0000 (20:04 -0500)]
racy-git: TODO to use improved diffing

9 years agoMove filelist into the iterator handling itself.
Edward Thomson [Wed, 29 Jul 2015 00:55:37 +0000 (19:55 -0500)]
Move filelist into the iterator handling itself.

9 years agoiterator: use an options struct instead of args
Edward Thomson [Tue, 28 Jul 2015 16:41:27 +0000 (11:41 -0500)]
iterator: use an options struct instead of args

9 years agoMerge pull request #3399 from arthurschreiber/patch-8
Edward Thomson [Wed, 26 Aug 2015 21:08:35 +0000 (17:08 -0400)]
Merge pull request #3399 from arthurschreiber/patch-8

Fix a typo [ci skip]

9 years agoFix a typo [ci skip]
Arthur Schreiber [Wed, 26 Aug 2015 21:08:03 +0000 (23:08 +0200)]
Fix a typo [ci skip]

9 years agoMerge pull request #3396 from ethomson/copying
Carlos Martín Nieto [Tue, 25 Aug 2015 17:09:38 +0000 (19:09 +0200)]
Merge pull request #3396 from ethomson/copying

COPYING: include winhttp definition copyright

9 years agoCOPYING: include winhttp definition copyright
Edward Thomson [Tue, 25 Aug 2015 15:20:37 +0000 (11:20 -0400)]
COPYING: include winhttp definition copyright

Include the copyright notice from the deps/winhttp/ sources.  Move the
LGPL to the bottom of the file (since multiple dependencies are LGPL
licensed) and include the actual copyright notices from the regex sources.

9 years agoMerge pull request #3355 from palmin/palmin/fix-2830
Carlos Martín Nieto [Mon, 24 Aug 2015 22:39:58 +0000 (00:39 +0200)]
Merge pull request #3355 from palmin/palmin/fix-2830

Include the 4 characters not recognised as hex-number in parse_len

9 years agoFix 'If we're dealing with a directory' check
Vsevolod Parfenov [Mon, 24 Aug 2015 15:47:48 +0000 (18:47 +0300)]
Fix 'If we're dealing with a directory' check

9 years agoMerge pull request #3388 from libgit2/cmn/smart-callbacks
Carlos Martín Nieto [Thu, 20 Aug 2015 12:54:22 +0000 (14:54 +0200)]
Merge pull request #3388 from libgit2/cmn/smart-callbacks

transport: provide a way to get the callbacks

9 years agoMerge pull request #3389 from libgit2/cmn/old-security
Carlos Martín Nieto [Thu, 20 Aug 2015 12:53:51 +0000 (14:53 +0200)]
Merge pull request #3389 from libgit2/cmn/old-security

CMake: fall back to OpenSSL on older OS X

9 years agoCMake: fall back to OpenSSL on older OS X
Carlos Martín Nieto [Wed, 19 Aug 2015 10:53:31 +0000 (12:53 +0200)]
CMake: fall back to OpenSSL on older OS X

Starting at OS X 10.8, the Security framework offers some functions
which are unified across OS X and iOS. These are the functions that we
use.

Older versions of OS X do not have these functions and we fail to
compile. In these situations, fall back to using OpenSSL for our TLS
stream instead.

9 years agocred: add a free function wrapper
Carlos Martín Nieto [Tue, 18 Aug 2015 22:46:28 +0000 (00:46 +0200)]
cred: add a free function wrapper

9 years agotransport: provide a way to get the callbacks
Carlos Martín Nieto [Tue, 18 Aug 2015 18:55:59 +0000 (20:55 +0200)]
transport: provide a way to get the callbacks

libgit2 implementations of smart subtransports can simply reach through
the structure, but external implementors cannot.

Add these two functions as a way for the smart subtransports to get the
callbacks as set by the user.

9 years agoMerge pull request #3387 from leoyanggit/build_warning
Carlos Martín Nieto [Tue, 18 Aug 2015 14:09:28 +0000 (16:09 +0200)]
Merge pull request #3387 from leoyanggit/build_warning

Fix build warning: implicit declaration of function ‘git_transaction_config_new’

9 years agoFix build warning: implicit declaration of function ‘git_transaction_config_new’
Leo Yang [Mon, 17 Aug 2015 19:18:47 +0000 (15:18 -0400)]
Fix build warning: implicit declaration of function ‘git_transaction_config_new’

9 years agoInclude the 4 characters not recognised as hex-number when setting error in parse_len
Anders Borum [Wed, 5 Aug 2015 16:50:25 +0000 (18:50 +0200)]
Include the 4 characters not recognised as hex-number when setting error in parse_len

9 years agoMerge pull request #3377 from dleehr/fix-push-cb
Edward Thomson [Sat, 15 Aug 2015 20:46:32 +0000 (13:46 -0700)]
Merge pull request #3377 from dleehr/fix-push-cb

Fix bug in git_smart__push: push_transfer_progress cb is only called at end

9 years agoMerge pull request #3384 from libgit2/cmn/regex-nofail
Edward Thomson [Sat, 15 Aug 2015 20:43:46 +0000 (13:43 -0700)]
Merge pull request #3384 from libgit2/cmn/regex-nofail

diff: don't error out on an invalid regex

9 years agoMerge pull request #3383 from libgit2/cmn/http-error
Edward Thomson [Sat, 15 Aug 2015 20:42:51 +0000 (13:42 -0700)]
Merge pull request #3383 from libgit2/cmn/http-error

http: propagate the credentials callback's error code

9 years agodiff: don't error out on an invalid regex
Carlos Martín Nieto [Sat, 15 Aug 2015 16:46:38 +0000 (18:46 +0200)]
diff: don't error out on an invalid regex

When parsing user-provided regex patterns for functions, we must not
fail to provide a diff just because a pattern is not well
formed. Ignore it instead.

9 years agohttp: propagate the credentials callback's error code
Carlos Martín Nieto [Sat, 15 Aug 2015 16:15:23 +0000 (18:15 +0200)]
http: propagate the credentials callback's error code

When we ask for credentials, the user may choose to return EUSER to
indicate that an error has happened on its end and it wants to be given
back control.

We must therefore pass that back to the user instead of mentioning that
it was on_headers_complete() that returned an error code. Since we can,
we return the exact error code from the user (other than PASSTHROUGH)
since it doesn't cost anything, though using other error codes aren't
recommended.

9 years agoMerge pull request #3362 from libgit2/cmn/curl-proxyauth-any
Carlos Martín Nieto [Fri, 14 Aug 2015 20:12:59 +0000 (22:12 +0200)]
Merge pull request #3362 from libgit2/cmn/curl-proxyauth-any

curl: use the most secure auth method for the proxy

9 years agoindex: keep a hash table as well as a vector of entries
Carlos Martín Nieto [Fri, 14 Aug 2015 19:10:12 +0000 (21:10 +0200)]
index: keep a hash table as well as a vector of entries

The hash table allows quick lookup of specific paths, while we use the
vector for enumeration.

9 years agoindex: add tests around case switching
Carlos Martín Nieto [Fri, 14 Aug 2015 19:06:51 +0000 (21:06 +0200)]
index: add tests around case switching

We were missing tests for switching the case-sensitivity of an index
in-memory and then looking up entries in it.

9 years agoAdd a hashmap for index entries
Carlos Martín Nieto [Fri, 14 Aug 2015 19:06:09 +0000 (21:06 +0200)]
Add a hashmap for index entries

They are hashed case-insensitively and take the stage into account.

9 years agoadded a single line of additional error reporting from libssh2 when failing to retrie...
Max Leske [Fri, 14 Aug 2015 13:42:59 +0000 (15:42 +0200)]
added a single line of additional error reporting from libssh2 when failing to retrieve the list of authentication methods

9 years agoFix bug in git_smart__push: push_transfer_progress cb is never called
Dan Leehr [Fri, 14 Aug 2015 02:52:52 +0000 (22:52 -0400)]
Fix bug in git_smart__push: push_transfer_progress cb is never called

The conditional checked cbs->transfer_progress then used the value in cbs->push_transfer_progress. In both cases it should be push_transfer_progress

9 years agoMerge pull request #3168 from libgit2/cmn/config-tx
Edward Thomson [Thu, 13 Aug 2015 17:22:50 +0000 (10:22 -0700)]
Merge pull request #3168 from libgit2/cmn/config-tx

Locking and transactional/atomic updates for config