Commit Graph

8663 Commits

Author SHA1 Message Date
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
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
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
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
Carlos Martín Nieto
a38afb9547 Merge pull request #3387 from leoyanggit/build_warning
Fix build warning: implicit declaration of function ‘git_transaction_config_new’
2015-08-18 16:09:28 +02:00
Leo Yang
26ea28f32b Fix build warning: implicit declaration of function ‘git_transaction_config_new’ 2015-08-17 15:18:47 -04:00
Anders Borum
2d1d2bb59f Include the 4 characters not recognised as hex-number when setting error in parse_len 2015-08-17 07:58:31 +02:00
Edward Thomson
252f86e1be Merge pull request #3377 from dleehr/fix-push-cb
Fix bug in git_smart__push: push_transfer_progress cb is only called at end
2015-08-15 13:46:32 -07:00
Edward Thomson
0ba62ba526 Merge pull request #3384 from libgit2/cmn/regex-nofail
diff: don't error out on an invalid regex
2015-08-15 13:43:46 -07:00
Edward Thomson
f594b6ff15 Merge pull request #3383 from libgit2/cmn/http-error
http: propagate the credentials callback's error code
2015-08-15 13:42:51 -07:00
Carlos Martín Nieto
e451cd5c03 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.
2015-08-15 18:46:38 +02:00
Carlos Martín Nieto
11bca2d265 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.
2015-08-15 18:15:23 +02:00
Carlos Martín Nieto
755004eaed Merge pull request #3362 from libgit2/cmn/curl-proxyauth-any
curl: use the most secure auth method for the proxy
2015-08-14 22:12:59 +02:00
Carlos Martín Nieto
af1d5239a1 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.
2015-08-14 21:10:12 +02:00
Carlos Martín Nieto
c232d6c32d 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.
2015-08-14 21:06:51 +02:00
Carlos Martín Nieto
ac02a69470 Add a hashmap for index entries
They are hashed case-insensitively and take the stage into account.
2015-08-14 21:06:09 +02:00
Dan Leehr
b0b2c72274 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
2015-08-13 22:52:52 -04:00
Edward Thomson
9f1af7f279 Merge pull request #3168 from libgit2/cmn/config-tx
Locking and transactional/atomic updates for config
2015-08-13 10:22:50 -07:00
Edward Thomson
1573acbbd9 Merge pull request #3372 from libgit2/cmn/mirror-refspec
remote: don't confuse tag auto-follow rules with refspec matching
2015-08-12 08:46:50 -07:00
Carlos Martín Nieto
5340d63d38 config: perform unlocking via git_transaction
This makes the API for commiting or discarding changes the same as for
references.
2015-08-12 04:09:38 +02:00
Carlos Martín Nieto
36f784b538 config: expose locking via the main API
This lock/unlock pair allows for the cller to lock a configuration file
to avoid concurrent operations.

It also allows for a transactional approach to updating a configuration
file. If multiple updates must be made atomically, they can be done
while the config is locked.
2015-08-12 04:09:38 +02:00