Commit Graph

8635 Commits

Author SHA1 Message Date
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
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
Carlos Martín Nieto
b166703964 config: implement basic transactional support
When a configuration file is locked, any updates made to it will be done
to the in-memory copy of the file. This allows for multiple updates to
happen while we hold the lock, preventing races during complex
config-file manipulation.
2015-08-12 04:09:09 +02:00
Carlos Martín Nieto
3ce9e4d235 config: write the modified file to memory
Instead of writing into the filebuf directly, make the functions to
write the modified config file write into a buffer which can then be
dumped into the lockfile for committing.

This allows us to re-use the same code for modifying a locked
configuration, as we can simply skip the last step of dumping the data
to disk.
2015-08-12 04:09:08 +02:00
Carlos Martín Nieto
bbbd0cbd6d Merge pull request #3363 from ripdev/master
Forcing libssh2 lib location in CMake
2015-08-12 04:04:39 +02:00
Carlos Martín Nieto
e3e017d483 remote: don't confuse tag auto-follow rules with refspec matching
When we're looking to update a tag, we can't stop if the tag auto-follow
rules don't say to update it. The tag might still match the refspec we
were given.
2015-08-11 22:51:53 +02:00
Carlos Martín Nieto
a879276783 remote: add failing test for a mirror refspec
While we download the remote's remote-tracking branches, we don't
download the tag. This points to the tag auto-follow rules interfering
with the refspec.
2015-08-11 20:44:19 +02:00
Carlos Martín Nieto
dc0351893a curl: use the most secure auth method for the proxy
When curl uses a proxy, it will only use Basic unless we prompt it to
try to use the most secure on it has available.

This is something which git did recently, and it seems like a good idea.
2015-08-06 13:02:35 +02:00
Slava Karpenko
c27b4afcdd Forcing libssh2 lib location
OS X may have libssh2 in diff locations, so CHECK_LIBRARY_EXISTS may check the wrong lib; forcing it to use a found directory.
2015-08-06 11:06:17 +03:00
Edward Thomson
98f7bd289d Merge pull request #3360 from nodegit/master-duplicate-basename-fix
Fix duplicate basenames to support older VS on master
2015-08-05 16:26:43 -05:00
John Haley
eba784d24d Fix duplicate basenames to support older VS
With Visual Studio versions 2008 and older they ignore the full path to files and only check
the basename of the file to find a collision. Additionally, having duplicate basenames can break
other build tools like GYP.

This fixes https://github.com/libgit2/libgit2/issues/3356
2015-08-05 13:02:58 -07:00
Carlos Martín Nieto
cf716beed2 Merge pull request #3351 from ethomson/error_buf
Error handling: use buffers, improved OOM handling
2015-08-04 11:18:21 +02:00
Edward Thomson
ef4857c2b3 errors: tighten up git_error_state OOMs a bit more
When an error state is an OOM, make sure that we treat is specially
and do not try to free it.
2015-08-03 19:44:51 -04:00
Edward Thomson
854b701c8a Merge remote-tracking branches 'upstream/pr/3323' and 'upstream/pr/3329' 2015-08-03 15:02:02 -05:00
Michael Procter
988ea59443 Test: check restored oom error points to static buffer 2015-08-03 15:23:17 +01:00
Michael Procter
0fcfb60dc4 Make giterr_restore aware of g_git_oom_error
Allow restoring a previously captured oom error, by
detecting when the captured message pointer points to the
static oom error message.  This means there is no need
to strdup the message in giterr_detach.
2015-08-03 15:23:17 +01:00
Michael Procter
25dbcf3499 Make giterr_detach no longer public 2015-08-03 15:23:17 +01:00
Michael Procter
c2f17bda07 Ensure static oom error message not detached
Error messages that are detached are assumed to be dynamically
allocated.  Passing a pointer to the static oom error message
can cause an attempt to free the static buffer later.  This change
checks if the oom error message is about to be detached and detaches
a copy instead.
2015-08-03 15:23:17 +01:00
Michael Procter
5ef4b86015 Add failing test for capture/restore oom error 2015-08-03 15:23:17 +01:00
Edward Thomson
69adb781e1 Merge pull request #3325 from libgit2/cmn/filebuf-rename-error
filebuf: remove lockfile upon rename errors
2015-08-03 08:33:53 -05:00
Edward Thomson
0dd8daeada Merge pull request #3344 from libgit2/cmn/add-unreg-submodule
index: stage an unregistered submodule as well
2015-08-03 08:17:47 -05:00
Carlos Martín Nieto
3cf4eb0922 Merge pull request #3348 from MrHacky/remote-path-with-tilde
Handle ssh:// and git:// urls containing a '~' character.
2015-08-03 10:29:17 +02:00
Simon
ac728c2483 Handle ssh:// and git:// urls containing a '~' character.
For such a path '/~/...' the leading '/' is stripped so the server will
get a path starting with '~' and correctly handle it.
2015-08-03 07:38:07 +01:00
Carlos Martín Nieto
ea961abf24 index: stage an unregistered submodule as well
We previously added logic to `_add_bypath()` to update a submodule. Go
further and stage the submodule even if it's not registered to behave
like git.
2015-08-01 20:01:11 +02:00
Carlos Martín Nieto
b426ac90a9 index: test that an unregistered submodule gets staged
When we pass the path of a repository to `_bypath()`, we should behave
like git and stage it as a `_COMMIT` regardless of whether it is
registered a a submodule.
2015-08-01 19:52:25 +02:00
Linquize
63e5b55122 index: add test for adding an old-style submodule to index 2015-08-01 19:35:59 +02:00
Carlos Martín Nieto
c400bac4db Merge pull request #3332 from phatblat/ben/doc-warnings
Resolve documentation warnings
2015-08-01 15:38:04 +02:00
Edward Thomson
723babd712 Merge pull request #3341 from stewid/pedantic-compiler-warning
Remove extra semicolon outside of a function
2015-07-31 15:36:22 -05:00
Stefan Widgren
c369b37919 Remove extra semicolon outside of a function
Without this change, compiling with gcc and pedantic generates warning:
ISO C does not allow extra ‘;’ outside of a function.
2015-07-31 16:23:11 +02:00