Commit Graph

8781 Commits

Author SHA1 Message Date
Matt Burke
80ee25434d Teach winhttp about the extra headers 2015-09-08 14:04:59 -04:00
Matt Burke
276f6aa08d Hook up the custom_headers to the http transport 2015-09-08 14:02:47 -04:00
Matt Burke
4f2b6093a6 Tell the git_transport about the custom_headers 2015-09-08 14:02:33 -04:00
Matt Burke
9da32a6255 Add custom_headers to git_push_options 2015-09-08 14:02:25 -04:00
Matt Burke
24f5b4e155 Drop extra_http_headers from git_remote 2015-09-08 14:01:57 -04:00
Edward Thomson
c1770aeb8b Merge pull request #3410 from libgit2/cmn/ssh-embed-again
Revert "Get rid of libssh2 embedding"
2015-09-08 12:43:36 -04:00
Carlos Martín Nieto
6d6020defc Merge pull request #3353 from ethomson/wrongcase_add
index: canonicalize directory case when adding
2015-09-08 18:34:51 +02:00
Edward Thomson
2964cbeae1 Merge pull request #3381 from leoyanggit/index_directory_iterator
New feature: add the ablility to iterate through a directory in index
2015-09-08 11:50:08 -04:00
Edward Thomson
a32bc85e84 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.
2015-09-08 11:34:00 -04:00
Edward Thomson
280adb3f94 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`.
2015-09-08 11:32:40 -04:00
Edward Thomson
e1d27bcaaf Merge pull request #3413 from libgit2/cmn/follow-symlink
filebuf: follow symlinks when creating a lock file
2015-09-06 10:51:29 -04:00
Edward Thomson
9fd4c9c867 Merge pull request #3366 from libgit2/cmn/index-hashmap
Use a hashmap for path-based lookups in the index
2015-09-06 10:50:22 -04:00
Carlos Martín Nieto
d83b2e9f51 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.
2015-09-05 16:43:49 +02:00
Leo Yang
c097f7173d New API: git_index_find_prefix
Find the first index entry matching a prefix.
2015-09-04 12:24:36 -04:00
Matt Burke
59d6128e27 Allow the world to set HTTP headers for remotes 2015-09-04 09:36:50 -04:00
Matt Burke
ac9b512789 Pull extra_http_headers from the git_remote 2015-09-04 09:20:45 -04:00
Matt Burke
6af6e69009 Put the extra headers on the connection_data instead 2015-09-04 09:18:32 -04:00
Matt Burke
c3733e5641 Add more headers to HTTP requests 2015-09-04 09:01:30 -04:00
Carlos Martín Nieto
81b7636757 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.
2015-09-04 13:50:25 +02:00
Carlos Martín Nieto
01fe83741a 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 20dcb7315c.
2015-09-03 13:35:15 +02:00
Carlos Martín Nieto
1cef6b9f19 config: correct documentation for non-existent config file 2015-09-03 11:38:21 +02:00
Carlos Martín Nieto
21e7015ca3 Merge pull request #3402 from ethomson/faster_diff
Provide path matching in the iterators (for faster diffs)
2015-09-01 02:26:11 +02:00
Edward Thomson
53c2296bfe iterator: better document GIT_DIFF_DISABLE_PATHSPEC_MATCH 2015-08-31 19:41:43 -04:00
Edward Thomson
03210cfa00 iterator test: handle case (in)sensitivity 2015-08-31 12:16:16 -04:00
Edward Thomson
4d19bced3f iterator test: use new iter opts in fifo test 2015-08-31 11:48:12 -04:00
Edward Thomson
d53c888069 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.
2015-08-31 11:48:06 -04:00
Edward Thomson
56ed415a24 diff: drop FILELIST_MATCH
Now that non-pathspec matching diffs are implemented at the iterator
level, drop `FILELIST_MATCH`ing.
2015-08-30 19:11:31 -04:00
Edward Thomson
71ef639e5f status test: brackets are now literal 2015-08-30 18:57:06 -04:00
Edward Thomson
7b73739fdd checkout: use pathlist-based iterators 2015-08-30 18:56:39 -04:00
Edward Thomson
1af84271dd tree_iterator: use a pathlist 2015-08-30 18:55:18 -04:00
Edward Thomson
4a0dbeb0d3 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`.
2015-08-30 17:06:26 -04:00
Carlos Martín Nieto
ed38e26db5 Merge pull request #3401 from phatblat/pb/doc-warning
Escape @ in doc comment
2015-08-30 15:47:49 +02:00
Ben Chatelain
91c9484c23 Escape @ in doc comment 2015-08-29 17:46:34 -06:00
Edward Thomson
3273ab3f0b 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.
2015-08-28 20:45:08 -04:00
Edward Thomson
aa06ecaf5b Merge pull request #3352 from ethomson/hidden
win32: ensure hidden files can be staged
2015-08-28 19:30:08 -04:00
Edward Thomson
6c9352bf30 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/'.
2015-08-28 18:40:02 -04:00
Edward Thomson
810cabb9df racy-git: TODO to use improved diffing 2015-08-28 18:39:57 -04:00
Edward Thomson
ef206124de Move filelist into the iterator handling itself. 2015-08-28 18:39:52 -04:00
Edward Thomson
ed1c64464a iterator: use an options struct instead of args 2015-08-28 18:39:47 -04:00
Edward Thomson
126932eb0b Merge pull request #3399 from arthurschreiber/patch-8
Fix a typo [ci skip]
2015-08-26 17:08:35 -04:00
Arthur Schreiber
fec4a68cf9 Fix a typo [ci skip] 2015-08-26 23:08:03 +02:00
Carlos Martín Nieto
c1322a9ee6 Merge pull request #3396 from ethomson/copying
COPYING: include winhttp definition copyright
2015-08-25 19:09:38 +02:00
Edward Thomson
afe0ff1a5d 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.
2015-08-25 11:20:37 -04:00
Carlos Martín Nieto
1947592461 Merge pull request #3355 from palmin/palmin/fix-2830
Include the 4 characters not recognised as hex-number in parse_len
2015-08-25 00:39:58 +02:00
Vsevolod Parfenov
6d0defe31c Fix 'If we're dealing with a directory' check 2015-08-24 18:47:48 +03:00
Carlos Martín Nieto
6b36945d7e Merge pull request #3388 from libgit2/cmn/smart-callbacks
transport: provide a way to get the callbacks
2015-08-20 14:54:22 +02:00
Carlos Martín Nieto
8820160818 Merge pull request #3389 from libgit2/cmn/old-security
CMake: fall back to OpenSSL on older OS X
2015-08-20 14:53:51 +02:00
Carlos Martín Nieto
b445940e2d 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.
2015-08-19 12:53:31 +02:00
Carlos Martín Nieto
57af0b928e cred: add a free function wrapper 2015-08-19 02:23:18 +02:00
Carlos Martín Nieto
47ed7e5acd 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.
2015-08-19 02:23:18 +02:00