]> git.proxmox.com Git - libgit2.git/log
libgit2.git
9 years agoMerge pull request #3233 from ethomson/status_typechange
Carlos Martín Nieto [Sat, 20 Jun 2015 21:17:42 +0000 (23:17 +0200)]
Merge pull request #3233 from ethomson/status_typechange

Don't propagate workdir's mode to the index during diff's update index

9 years agodiff: preserve original mode in the index
Edward Thomson [Fri, 19 Jun 2015 15:32:26 +0000 (08:32 -0700)]
diff: preserve original mode in the index

When updating the index during a diff, preserve the original mode,
which prevents us from dropping the mode to what we have interpreted
as on our system (eg, what the working directory claims it to be,
which may be a lie on some systems.)

9 years agostatus: test that symlinks don't lose their mode
Edward Thomson [Fri, 19 Jun 2015 15:31:07 +0000 (08:31 -0700)]
status: test that symlinks don't lose their mode

Test to ensure that when status updates an index, it does not alter
the original mode for file types that are not supported (eg, symlinks
on Windows).

9 years agoMerge pull request #3238 from git-up/double_free
Edward Thomson [Sat, 20 Jun 2015 18:34:34 +0000 (14:34 -0400)]
Merge pull request #3238 from git-up/double_free

Fixed index being double-freed in stash tests

9 years agoMerge pull request #3236 from libgit2/cmn/index-checksum
Edward Thomson [Sat, 20 Jun 2015 18:05:02 +0000 (14:05 -0400)]
Merge pull request #3236 from libgit2/cmn/index-checksum

Use the checksum to check whether an index has been modified

9 years agoFixed index being double-freed in stash tests
Pierre-Olivier Latour [Sat, 20 Jun 2015 17:57:03 +0000 (10:57 -0700)]
Fixed index being double-freed in stash tests

9 years agoindex: make relative comparison use the checksum as well
Carlos Martín Nieto [Sat, 20 Jun 2015 14:17:28 +0000 (16:17 +0200)]
index: make relative comparison use the checksum as well

This is used by the submodule in order to figure out if the index has
changed since it last read it. Using a timestamp is racy, so let's make
it use the checksum, just like we now do for reloading the index itself.

9 years agoMerge pull request #3232 from Therzok/patch-2
Carlos Martín Nieto [Sat, 20 Jun 2015 10:14:49 +0000 (12:14 +0200)]
Merge pull request #3232 from Therzok/patch-2

Quote LIBSSH2_LIBRARIES call

9 years agotests: tick over five seconds instead of one
Carlos Martín Nieto [Thu, 18 Jun 2015 10:45:40 +0000 (12:45 +0200)]
tests: tick over five seconds instead of one

When ticking over one second, it can happen that the actual time ticks
over the same second between the time that we undermine our own race
protections and the time in which we perform the index update. Such
timing would make the time in the entries match the index' timestamp and
we have not gained anything.

Ticking over five seconds makes it so that if real-time rolls over that
second, our index is still ahead. This is still suboptimal as we're
dealing with timing, but five seconds should be long enough for any
reasonable test runner to finish the tests.

9 years agoindex: use the checksum to check whether it's been modified
Carlos Martín Nieto [Fri, 19 Jun 2015 20:05:08 +0000 (22:05 +0200)]
index: use the checksum to check whether it's been modified

We currently use a timetamp to check whether an index file has been
modified since we last read it, but this is racy. If two updates happen
in the same second and we read after the first one, we won't detect the
second one.

Instead read the SHA-1 checksum of the file, which are its last 20 bytes which
gives us a sure-fire way to detect whether the file has changed since we
last read it.

As we're now keeping track of it, expose an accessor to this data.

9 years agoindex: user a better assertion when comparing sizes
Carlos Martín Nieto [Fri, 19 Jun 2015 19:56:42 +0000 (21:56 +0200)]
index: user a better assertion when comparing sizes

This will tell us which numbers we were trying to compare, rather than
just telling us that they're different.

9 years agoQuote LIBSSH2_LIBRARIES call
Marius Ungureanu [Fri, 19 Jun 2015 09:53:37 +0000 (12:53 +0300)]
Quote LIBSSH2_LIBRARIES call

Credits to @directhex

It is possible for PKG_CHECK_MODULES(LIBSSH2 libssh2) to LIBSSH2_LIBRARIES to a string with more than one library in it - e.g. if your libssh2 was built against libgcrypt, it will be "ssh2;gcrypt"

Quoting the string is needed, or CHECK_LIBRARY_EXISTS will fail.

9 years agoMerge pull request #3229 from git-up/build_warnings
Carlos Martín Nieto [Wed, 17 Jun 2015 19:36:27 +0000 (21:36 +0200)]
Merge pull request #3229 from git-up/build_warnings

Fixed Xcode 6.1 build warnings

9 years agoFixed Xcode 6.1 build warnings
Pierre-Olivier Latour [Wed, 17 Jun 2015 16:00:23 +0000 (09:00 -0700)]
Fixed Xcode 6.1 build warnings

9 years agoMerge pull request #3227 from jeffhostetler/memory_leak__tests_network_refspecs
Carlos Martín Nieto [Wed, 17 Jun 2015 14:08:20 +0000 (16:08 +0200)]
Merge pull request #3227 from jeffhostetler/memory_leak__tests_network_refspecs

Fix memory leak in tests/network/refspecs.c

9 years agoFix memory leak in tests/network/refspecs.c
Jeff Hostetler [Wed, 17 Jun 2015 12:52:28 +0000 (08:52 -0400)]
Fix memory leak in tests/network/refspecs.c

9 years agoMerge pull request #3219 from libgit2/cmn/racy-diff
Carlos Martín Nieto [Wed, 17 Jun 2015 06:15:49 +0000 (08:15 +0200)]
Merge pull request #3219 from libgit2/cmn/racy-diff

Zero out racily-clean entries' file_size

9 years agocheckout: allow workdir to contain checkout target
Edward Thomson [Tue, 16 Jun 2015 21:23:12 +0000 (17:23 -0400)]
checkout: allow workdir to contain checkout target

When checking out some file 'foo' that has been modified in the
working directory, allow the checkout to proceed (do not conflict)
if 'foo' is identical to the target of the checkout.

9 years agomerge::workdir::dirty: tick idx to defeat racy-git
Edward Thomson [Tue, 16 Jun 2015 20:34:25 +0000 (16:34 -0400)]
merge::workdir::dirty: tick idx to defeat racy-git

9 years agoIntroduce p_utimes and p_futimes
Edward Thomson [Tue, 16 Jun 2015 19:18:04 +0000 (15:18 -0400)]
Introduce p_utimes and p_futimes

Provide functionality to set the time on a filesystem entry,
using utimes or futimes on POSIX type systems or SetFileTime
on Win32.

9 years agoMerge pull request #3209 from libgit2/cmn/double-author
Edward Thomson [Tue, 16 Jun 2015 14:40:46 +0000 (10:40 -0400)]
Merge pull request #3209 from libgit2/cmn/double-author

commit: ignore multiple author fields

9 years agoMerge pull request #3225 from libgit2/cmn/url-empty
Edward Thomson [Tue, 16 Jun 2015 12:45:55 +0000 (08:45 -0400)]
Merge pull request #3225 from libgit2/cmn/url-empty

remote: return EINVALIDSPEC when given an empty URL

9 years agoremote: return EINVALIDSPEC when given an empty URL
Carlos Martín Nieto [Tue, 16 Jun 2015 10:39:11 +0000 (12:39 +0200)]
remote: return EINVALIDSPEC when given an empty URL

This is what we used to return in the settter and there's tests in
bindings which ask for this. There's no particular reason to stop doing
so.

9 years agoMerge pull request #3221 from git-up/build_warnings
Carlos Martín Nieto [Tue, 16 Jun 2015 07:20:36 +0000 (09:20 +0200)]
Merge pull request #3221 from git-up/build_warnings

Fixed Xcode 6.1 build warnings

9 years agotests: tick the index when we count OID calculations
Carlos Martín Nieto [Tue, 16 Jun 2015 06:51:45 +0000 (08:51 +0200)]
tests: tick the index when we count OID calculations

These tests want to test that we don't recalculate entries which match
the index already. This is however something we force when truncating
racily-clean entries.

Tick the index forward as we know that we don't perform the
modifications which the racily-clean code is trying to avoid.

9 years agocrlf: tick the index forward to work around racy-git behaviour
Carlos Martín Nieto [Mon, 15 Jun 2015 12:32:08 +0000 (14:32 +0200)]
crlf: tick the index forward to work around racy-git behaviour

In order to avoid racy-git, we zero out the file size for entries with
the same timestamp as the index (or during the initial checkout). This
is the case in a couple of crlf tests, as the code is fast enough to do
everything in the same second.

As we know that we do not perform the modification just after writing
out the index, which is what this is designed to work around, tick the
mtime of the index file such that it doesn't agree with the files
anymore, and we do not zero out these entries.

9 years agoindex: zero the size of racily-clean entries
Carlos Martín Nieto [Mon, 15 Jun 2015 07:55:40 +0000 (09:55 +0200)]
index: zero the size of racily-clean entries

If a file entry has the same timestamp as the index itself, it is
considered racily-clean, as it may have been modified after the index
was written, but during the same second. We take extra steps to check
the contents, but this is just one part of avoiding races.

For files which do have changes but have not been updated in the index,
updating the on-disk index means updating its timestamp, which means we
would no longer recognise these entries as racy and we would trust the
timestamp to tell us whether they have changed.

In order to work around this, git zeroes out the file-size field in
entries with the same timestamp as the index in order to force the next
diff to check the contents. Do so in libgit2 as well.

9 years agodiff: add failing test for racy-git in the index
Carlos Martín Nieto [Mon, 15 Jun 2015 07:51:34 +0000 (09:51 +0200)]
diff: add failing test for racy-git in the index

We update the index and then immediately change the contents of the
file. This makes the diff think there are no changes, as the timestamp
of the file agrees with the cached data. This is however a bug, as the
file has obviously changed contents.

The test is a bit fragile, as it assumes that the index writing and the
following modification of the file happen in the same second, but it's
enough to show the issue.

9 years agoMerge pull request #3216 from dprofeta/fixTransactionVisibility
Edward Thomson [Mon, 15 Jun 2015 21:10:35 +0000 (17:10 -0400)]
Merge pull request #3216 from dprofeta/fixTransactionVisibility

Fix visibility of transaction symbol

9 years agoFixed Xcode 6.1 build warnings
Pierre-Olivier Latour [Mon, 15 Jun 2015 16:52:40 +0000 (09:52 -0700)]
Fixed Xcode 6.1 build warnings

9 years agoMerge pull request #3220 from libgit2/cmn/readdir
Edward Thomson [Mon, 15 Jun 2015 13:11:32 +0000 (09:11 -0400)]
Merge pull request #3220 from libgit2/cmn/readdir

path: remove unnecessary readdir_r usage

9 years agopath: remove unnecessary readdir_r usage
Carlos Martín Nieto [Mon, 15 Jun 2015 11:28:08 +0000 (13:28 +0200)]
path: remove unnecessary readdir_r usage

Arguably all uses of readdir_r are unnecessary, but in this case
especially so, as the directory handle only exists within this function,
so we don't race with anybody.

9 years agoMerge pull request #3171 from libgit2/cmn/link-fallback
Carlos Martín Nieto [Mon, 15 Jun 2015 08:20:58 +0000 (10:20 +0200)]
Merge pull request #3171 from libgit2/cmn/link-fallback

clone: fall back to copying when linking does not work

9 years agoFix in stransport_stream.c for usage of SecCopyErrorMessageString(), which is unavail...
Logan Collins [Thu, 7 May 2015 21:21:25 +0000 (14:21 -0700)]
Fix in stransport_stream.c for usage of SecCopyErrorMessageString(), which is unavailable to iOS targets.

9 years agoMerge pull request #3177 from ethomson/binary_diff
Carlos Martín Nieto [Mon, 15 Jun 2015 06:17:45 +0000 (08:17 +0200)]
Merge pull request #3177 from ethomson/binary_diff

Binary diffs: store deltas in the diff structure, include binary data in diff callbacks

9 years agoMerge pull request #3217 from jeffhostetler/leak_checkout_icase
Carlos Martín Nieto [Mon, 15 Jun 2015 06:09:21 +0000 (08:09 +0200)]
Merge pull request #3217 from jeffhostetler/leak_checkout_icase

Fix leaks in tests/checkout/icase

9 years agoMerge pull request #3215 from jeffhostetler/windows_leak_diriter
Carlos Martín Nieto [Fri, 12 Jun 2015 16:35:18 +0000 (18:35 +0200)]
Merge pull request #3215 from jeffhostetler/windows_leak_diriter

Fix memory leak on windows in diriter.

9 years agoFix leaks in tests/checkout/icase
Jeff Hostetler [Fri, 12 Jun 2015 16:28:47 +0000 (09:28 -0700)]
Fix leaks in tests/checkout/icase

9 years agoFix visibility of transaction symbol
Damien PROFETA [Fri, 12 Jun 2015 16:14:32 +0000 (18:14 +0200)]
Fix visibility of transaction symbol

Transaction.c did not include the visibility definition of its symbol
(that are in git2/transaction.h) and so was by default hidden.

9 years agoFix memory leak on windows in diriter.
Jeff Hostetler [Fri, 12 Jun 2015 15:50:48 +0000 (08:50 -0700)]
Fix memory leak on windows in diriter.

9 years agobinary diff: document changes in CHANGELOG
Edward Thomson [Fri, 12 Jun 2015 13:28:19 +0000 (09:28 -0400)]
binary diff: document changes in CHANGELOG

9 years agopatch: include diff options on blob->blob diffs
Edward Thomson [Tue, 2 Jun 2015 22:28:06 +0000 (18:28 -0400)]
patch: include diff options on blob->blob diffs

9 years agobinary diff: test binary blob to blob tests
Edward Thomson [Tue, 2 Jun 2015 22:26:22 +0000 (18:26 -0400)]
binary diff: test binary blob to blob tests

9 years agodiff: introduce binary diff callbacks
Edward Thomson [Tue, 26 May 2015 00:03:59 +0000 (20:03 -0400)]
diff: introduce binary diff callbacks

Introduce a new binary diff callback to provide the actual binary
delta contents to callers.  Create this data from the diff contents
(instead of directly from the ODB) to support binary diffs including
the workdir, not just things coming out of the ODB.

9 years agobinary diff: test index->workdir binary diffs
Edward Thomson [Tue, 26 May 2015 00:36:29 +0000 (20:36 -0400)]
binary diff: test index->workdir binary diffs

9 years agoMerge pull request #3208 from git-up/secure_transport
Carlos Martín Nieto [Fri, 12 Jun 2015 12:52:48 +0000 (14:52 +0200)]
Merge pull request #3208 from git-up/secure_transport

Fixed some Secure Transport issues on OS X

9 years agoMerge pull request #3214 from libgit2/cmn/push-tests
Carlos Martín Nieto [Fri, 12 Jun 2015 12:51:59 +0000 (14:51 +0200)]
Merge pull request #3214 from libgit2/cmn/push-tests

travis: fail if we fail the push tests

9 years agoclone: set the credentials callback during testing
Carlos Martín Nieto [Fri, 12 Jun 2015 10:45:49 +0000 (12:45 +0200)]
clone: set the credentials callback during testing

9 years agopush: pass the callbacks during setup as well
Carlos Martín Nieto [Fri, 12 Jun 2015 10:25:25 +0000 (12:25 +0200)]
push: pass the callbacks during setup as well

We need to pass these options in order to have the credentials callback
set.

9 years agotravis: fail if we fail the push tests
Carlos Martín Nieto [Fri, 12 Jun 2015 10:17:03 +0000 (12:17 +0200)]
travis: fail if we fail the push tests

These tests were not being taken into consideration for the failure of
the test. They've been failing for a while now, but we hadn't noticed as
Travis was reporting the builds successful.

9 years agoFixed some Secure Transport issues on OS X
Pierre-Olivier Latour [Fri, 12 Jun 2015 06:20:28 +0000 (23:20 -0700)]
Fixed some Secure Transport issues on OS X

The read and write callbacks passed to SSLSetIOFuncs() have been
rewritten to match the implementation used on opensource.apple.com and
other open source projects like VLC.

This change also fixes a bug where the read callback could get into
an infinite loop when 0 bytes were read.

9 years agoMerge pull request #3155 from mgorny/userpass-const
Carlos Martín Nieto [Thu, 11 Jun 2015 06:54:48 +0000 (08:54 +0200)]
Merge pull request #3155 from mgorny/userpass-const

cred_helpers: Add 'const' qualifiers to git_cred_userpass_payload

9 years agocommit: ignore multiple author fields
Carlos Martín Nieto [Thu, 11 Jun 2015 06:24:58 +0000 (08:24 +0200)]
commit: ignore multiple author fields

Some tools create multiple author fields. git is rather lax when parsing
them, although fsck does complain about them. This means that they exist
in the wild.

As it's not too taxing to check for them, and there shouldn't be a
noticeable slowdown when dealing with correct commits, add logic to skip
over these extra fields when parsing the commit.

9 years agoMerge pull request #3205 from ethomson/crlf_query
Carlos Martín Nieto [Thu, 11 Jun 2015 05:17:34 +0000 (07:17 +0200)]
Merge pull request #3205 from ethomson/crlf_query

Introduce `git_filter_list_contains`

9 years agoMerge pull request #3207 from ethomson/winhttp_eol
Carlos Martín Nieto [Thu, 11 Jun 2015 05:13:07 +0000 (07:13 +0200)]
Merge pull request #3207 from ethomson/winhttp_eol

Correct line endings on winhttp.def

9 years agoMerge pull request #3174 from libgit2/cmn/idx-fill-hole
Edward Thomson [Wed, 10 Jun 2015 20:43:48 +0000 (16:43 -0400)]
Merge pull request #3174 from libgit2/cmn/idx-fill-hole

indexer: use lseek to extend the packfile

9 years agoMerge pull request #3204 from git-up/git_diff_find_similar
Edward Thomson [Wed, 10 Jun 2015 20:42:07 +0000 (16:42 -0400)]
Merge pull request #3204 from git-up/git_diff_find_similar

Fixed handling of GIT_DELTA_CONFLICTED  in git_diff_find_similar()

9 years agoCorrect line endings on winhttp.def
Edward Thomson [Wed, 10 Jun 2015 20:36:38 +0000 (16:36 -0400)]
Correct line endings on winhttp.def

9 years agoIntroduce `git_filter_list_contains`
Edward Thomson [Wed, 10 Jun 2015 18:43:49 +0000 (14:43 -0400)]
Introduce `git_filter_list_contains`

`git_filter_list_contains` can be used to query a filter list to
determine if a given filter will be run.

9 years agoMerge pull request #3203 from ethomson/gitattributes
Carlos Martín Nieto [Wed, 10 Jun 2015 17:55:18 +0000 (19:55 +0200)]
Merge pull request #3203 from ethomson/gitattributes

gitattributes: let clients use native line endings

9 years agoFixed handling of GIT_DELTA_CONFLICTED in git_diff_find_similar()
Pierre-Olivier Latour [Wed, 10 Jun 2015 17:09:10 +0000 (10:09 -0700)]
Fixed handling of GIT_DELTA_CONFLICTED  in git_diff_find_similar()

git_diff_find_similar() now ignores git_diff_delta records with a status
of GIT_DELTA_CONFLICTED, which fixes a crash due to assert() being hit.

9 years agogitattributes: let clients use native line endings
Edward Thomson [Wed, 10 Jun 2015 16:24:06 +0000 (12:24 -0400)]
gitattributes: let clients use native line endings

Use "text=auto" to ensure that we get LFs in the repository, but
let clients have their native line endings in their worktree.

9 years agoMerge pull request #3201 from libgit2/cmn/coverity
Edward Thomson [Wed, 10 Jun 2015 13:02:54 +0000 (09:02 -0400)]
Merge pull request #3201 from libgit2/cmn/coverity

A few more fixes from coverity

9 years agofilter: close the descriptor in case of error
Carlos Martín Nieto [Wed, 10 Jun 2015 09:08:05 +0000 (11:08 +0200)]
filter: close the descriptor in case of error

When we hit an error writing to the next stream from a file, we jump to
'done' which currently skips over closing the file descriptor.

Make sure to close the descriptor if it has been set to a valid value.

9 years agoobject: correct the expected ID size in prefix lookup
Carlos Martín Nieto [Wed, 10 Jun 2015 08:59:56 +0000 (10:59 +0200)]
object: correct the expected ID size in prefix lookup

We take in a possibly partial ID by taking a length and working off of
that to figure out whether to just look up the object or ask the
backends for a prefix lookup.

Unfortunately we've been checking the size against `GIT_OID_HEXSZ` which
is the size of a *string* containing a full ID, whereas we need to check
against the size we can have when it's a 20-byte array.

Change the checks and comment to use `GIT_OID_RAWSZ` which is the
correct size of a git_oid to have when full.

9 years agopack: use git_buf when building the index name
Carlos Martín Nieto [Wed, 10 Jun 2015 08:44:14 +0000 (10:44 +0200)]
pack: use git_buf when building the index name

The way we currently do it depends on the subtlety of strlen vs sizeof
and the fact that .pack is one longer than .idx. Let's use a git_buf so
we can express the manipulation we want much more clearly.

9 years agomerge: actually increment the counts, not the pointers
Carlos Martín Nieto [Wed, 10 Jun 2015 08:30:08 +0000 (10:30 +0200)]
merge: actually increment the counts, not the pointers

`merge_diff_list_count_candidates()` takes pointers to the source and
target counts, but when it comes time to increase them, we're increasing
the pointer, rather than the value it's pointing to.

Dereference the value to increase.

9 years agocache: add a check for a failed allocation
Carlos Martín Nieto [Wed, 10 Jun 2015 08:23:08 +0000 (10:23 +0200)]
cache: add a check for a failed allocation

Rather minimal change, but it's the kind of thing we should do.

9 years agoMerge pull request #3198 from libgit2/cmn/coverity
Edward Thomson [Tue, 9 Jun 2015 21:06:28 +0000 (17:06 -0400)]
Merge pull request #3198 from libgit2/cmn/coverity

A few fixes from Coverity

9 years agoInitialize a few variables
Carlos Martín Nieto [Tue, 9 Jun 2015 14:53:07 +0000 (16:53 +0200)]
Initialize a few variables

Coverity complains about the git_rawobj ones because we use a loop in
which we keep remembering the old version, and we end up copying our
object as the base, so we want to have the data pointer be NULL.

9 years agossh: move NULL check to the free function
Carlos Martín Nieto [Tue, 9 Jun 2015 14:01:29 +0000 (16:01 +0200)]
ssh: move NULL check to the free function

Let `ssh_stream_free()` take a NULL stream, as free functions should,
and remove the check from the connection setup.

The connection setup would not need the check anyhow, as we always have
a stream by the time we reach this code.

9 years agoMerge pull request #3165 from ethomson/downcase
Carlos Martín Nieto [Mon, 8 Jun 2015 13:22:01 +0000 (15:22 +0200)]
Merge pull request #3165 from ethomson/downcase

Downcase

9 years agoMerge pull request #3188 from thentenaar/clean-up-after-openssl
Carlos Martín Nieto [Mon, 8 Jun 2015 10:21:36 +0000 (12:21 +0200)]
Merge pull request #3188 from thentenaar/clean-up-after-openssl

global: Ensure we free our SSL context.

9 years agoglobal: Ensure we free our SSL context.
Tim Hentenaar [Thu, 4 Jun 2015 00:22:10 +0000 (02:22 +0200)]
global: Ensure we free our SSL context.

9 years agoMerge pull request #3185 from libgit2/cmn/foreach-cancel-loose
Carlos Martín Nieto [Sun, 7 Jun 2015 13:10:28 +0000 (15:10 +0200)]
Merge pull request #3185 from libgit2/cmn/foreach-cancel-loose

path: error out if the callback returns an error

9 years agoMerge pull request #3175 from git-up/build_warnings
Carlos Martín Nieto [Sun, 7 Jun 2015 13:10:13 +0000 (15:10 +0200)]
Merge pull request #3175 from git-up/build_warnings

Fixed build warnings on Xcode 6.1

9 years agoremote: some error-handling issues from Coverity
Carlos Martín Nieto [Sun, 7 Jun 2015 08:45:39 +0000 (10:45 +0200)]
remote: some error-handling issues from Coverity

9 years agoMerge pull request #3179 from arielb2/master
Carlos Martín Nieto [Sun, 7 Jun 2015 08:03:31 +0000 (10:03 +0200)]
Merge pull request #3179 from arielb2/master

print_usage functions is defined but not used

9 years agopath: error out if the callback returns an error
Carlos Martín Nieto [Sat, 6 Jun 2015 01:55:28 +0000 (03:55 +0200)]
path: error out if the callback returns an error

When the callback returns an error, we should stop immediately. This
broke when trying to make sure we pass specific errors up the chain.

This broke cancelling out of the loose backend's foreach.

9 years agoMerge pull request #3172 from Therzok/patch-2
Carlos Martín Nieto [Thu, 4 Jun 2015 11:02:59 +0000 (13:02 +0200)]
Merge pull request #3172 from Therzok/patch-2

Change error when running out of ssh agent keys

9 years agoprint_usage functions is defined but not used
Ariel O. Barria [Wed, 3 Jun 2015 19:54:26 +0000 (14:54 -0500)]
print_usage functions is defined but not used

Use the previously created function to display a message when the arguments are not valid.

ticket 3095

9 years agoFixed build warnings on Xcode 6.1
Pierre-Olivier Latour [Tue, 2 Jun 2015 15:36:15 +0000 (08:36 -0700)]
Fixed build warnings on Xcode 6.1

9 years agoChange error when running out of ssh agent keys
Marius Ungureanu [Tue, 2 Jun 2015 07:23:54 +0000 (10:23 +0300)]
Change error when running out of ssh agent keys

9 years agoindexer: use lseek to extend the packfile
Carlos Martín Nieto [Tue, 2 Jun 2015 08:25:22 +0000 (10:25 +0200)]
indexer: use lseek to extend the packfile

We've been using `p_ftruncate()` to extend the packfile in order to mmap
it and write the new data into it. This works well in the general case,
but as truncation does not allocate space in the filesystem, it must do
so when we write data to it.

The only way the OS has to indicate a failure to allocate space is via
SIGBUS which means we tried to write outside the file. This will cause
everyone to crash as they don't expect to handle this signal.

Switch to using `p_lseek()` and `p_write()` to extend the file in a way
which tells the filesystem to allocate the space for the missing
data. We can then be sure that we have space to write into.

9 years agoclone: fall back to copying when linking does not work
Carlos Martín Nieto [Mon, 1 Jun 2015 20:15:11 +0000 (22:15 +0200)]
clone: fall back to copying when linking does not work

We use heuristics to make a decent guess at when we can save time and
space by linking object files during a clone. Unfortunately checking the
device id isn't enough, as those would be the same during e.g. a bind-mount,
but the OS still does not allow us to link between mounts of the same
filesystem.

If we fail to perform the links, fall back to copying the contents into
a new file as a last attempt.

9 years agoInclude git2/transaction.h
Carlos Martín Nieto [Sun, 31 May 2015 17:21:42 +0000 (19:21 +0200)]
Include git2/transaction.h

This was forgotten when the feature was implemented.

9 years agoMerge pull request #3152 from tkelman/patch-1
Carlos Martín Nieto [Sun, 31 May 2015 16:53:42 +0000 (18:53 +0200)]
Merge pull request #3152 from tkelman/patch-1

build maint branches on appveyor

9 years agoMerge pull request #3048 from pks-t/insteadof
Carlos Martín Nieto [Sun, 31 May 2015 13:45:56 +0000 (15:45 +0200)]
Merge pull request #3048 from pks-t/insteadof

Implementation of url.*.insteadOf

9 years agoremote: test insteadOf for anonymous remotes
Patrick Steinhardt [Thu, 21 May 2015 11:02:22 +0000 (13:02 +0200)]
remote: test insteadOf for anonymous remotes

9 years agoAdd CHANGELOG entry for url.*.insteadOf feature.
Patrick Steinhardt [Thu, 21 May 2015 10:46:04 +0000 (12:46 +0200)]
Add CHANGELOG entry for url.*.insteadOf feature.

9 years agoremote: apply insteadOf configuration.
Patrick Steinhardt [Mon, 4 May 2015 09:59:20 +0000 (11:59 +0200)]
remote: apply insteadOf configuration.

A remote's URLs are now modified according to the url.*.insteadOf
and url.*.pushInsteadOf configurations. This allows a user to
replace URL prefixes by setting the corresponding keys. E.g.
"url.foo.insteadOf = bar" would replace the prefix "bar" with the
new prefix "foo".

9 years agogit__tolower: test that some non-ASCII downcasing isn't
Edward Thomson [Fri, 29 May 2015 21:39:11 +0000 (17:39 -0400)]
git__tolower: test that some non-ASCII downcasing isn't

9 years agogit__tolower: a tolower() that isn't dumb
Edward Thomson [Fri, 29 May 2015 20:56:38 +0000 (16:56 -0400)]
git__tolower: a tolower() that isn't dumb

Some brain damaged tolower() implementations appear to want to
take the locale into account, and this may require taking some
insanely aggressive lock on the locale and slowing down what should
be the most trivial of trivial calls for people who just want to
downcase ASCII.

9 years agogit__strcasecmp: treat input bytes as unsigned
Edward Thomson [Fri, 29 May 2015 20:07:51 +0000 (16:07 -0400)]
git__strcasecmp: treat input bytes as unsigned

Treat input bytes as unsigned before doing arithmetic on them,
lest we look at some non-ASCII byte (like a UTF-8 character) as a
negative value and perform the comparison incorrectly.

9 years agoCHANGELOG: fill in a few missing entries
Carlos Martín Nieto [Fri, 29 May 2015 18:09:46 +0000 (20:09 +0200)]
CHANGELOG: fill in a few missing entries

9 years agoMerge pull request #3157 from mgorny/ssh_memory_auth
Carlos Martín Nieto [Fri, 29 May 2015 17:38:11 +0000 (19:38 +0200)]
Merge pull request #3157 from mgorny/ssh_memory_auth

Support getting SSH keys from memory, pt. 2

9 years agoMerge pull request #3163 from ethomson/emergeconflict
Carlos Martín Nieto [Fri, 29 May 2015 14:42:40 +0000 (16:42 +0200)]
Merge pull request #3163 from ethomson/emergeconflict

Rename GIT_EMERGECONFLICT to GIT_ECONFLICT

9 years agoRename GIT_EMERGECONFLICT to GIT_ECONFLICT
Edward Thomson [Thu, 28 May 2015 19:26:13 +0000 (15:26 -0400)]
Rename GIT_EMERGECONFLICT to GIT_ECONFLICT

We do not error on "merge conflicts"; on the contrary, merge conflicts
are a normal part of merging.  We only error on "checkout conflicts",
where a change exists in the index or the working directory that would
otherwise be overwritten by performing the checkout.

This *may* happen during merge (after the production of the new index
that we're going to checkout) but it could happen during any checkout.

9 years agoMerge pull request #3161 from fxfactorial/master
Edward Thomson [Thu, 28 May 2015 20:29:52 +0000 (16:29 -0400)]
Merge pull request #3161 from fxfactorial/master

Changed README to use new OCaml bindings to git

9 years agoChanged README to use new OCaml bindings to git
Edgar Aroutiounian [Thu, 28 May 2015 19:19:53 +0000 (15:19 -0400)]
Changed README to use new OCaml bindings to git