Commit Graph

8635 Commits

Author SHA1 Message Date
Edward Thomson
aa3af01db0 index iterator: optionally include conflicts 2015-05-28 09:43:41 -04:00
Carlos Martín Nieto
9566ce430f remote: call the update_tips callback for opportunisitc updates
These are updates, same as the rest, we should call this callback. As we
are using the callback, let's make sure to skip unnecessary updates.
2015-05-28 15:32:20 +02:00
Carlos Martín Nieto
c6e942fb3d remote: validate refspecs before adding to config
When we moved from acting on the instance to acting on the
configuration, we dropped the validation of the passed refspec, which
can lead to writing an invalid refspec to the configuration. Bring that
validation back.
2015-05-28 15:32:20 +02:00
Carlos Martín Nieto
ae5b93629c remote: remove fetch parameter from create_anonymous
An anonymous remote is not configured and cannot therefore have
configured refspecs. Remove the parameter which adds this from the
constructor.
2015-05-28 15:32:20 +02:00
Carlos Martín Nieto
c7f9412356 Merge pull request #3160 from b4n/ident-same-as-git
Fix ident replacement to match Git behavior
2015-05-28 02:40:22 +02:00
Michał Górny
8085adf82c test: Add a test for in-memory SSH private key cred_cb 2015-05-27 20:36:53 +02:00
Michał Górny
2629fc874d cred: Check for null values when getting key from memory
The public key field is optional and as such can take NULL. Account for
that and do not call strlen() on NULL values. Also assert() for non-NULL
values of username & private key.
2015-05-27 20:36:53 +02:00
Michał Górny
f7142b5e4a cred: Declare GIT_CREDTYPE_SSH_MEMORY unconditionally
Declare GIT_CREDTYPE_SSH_MEMORY to have consistent API independently of
whether libgit2 was built with or without in-memory key passing support.
Or rather, to have it at all since build-time definitions are not stored
in headers.
2015-05-27 20:36:53 +02:00
Michał Górny
1679ec1204 cmake: Add CMake check for libssh2 memory credential passing support 2015-05-27 20:36:53 +02:00
David Calavera
08e6b875c1 Return an error when ssh memory credentials are not supported.
To not modify the external api.
2015-05-27 20:36:53 +02:00
David Calavera
7a8b85032f Add support to read ssh keys from memory. 2015-05-27 20:36:53 +02:00
Colomban Wendling
1ecbcd8e51 Fix ident replacement to match Git behavior
Git inserts a space after the SHA1 (as of 2.1.4 at least), so do the
same.
2015-05-26 19:56:06 +02:00
Michał Górny
462865d702 cred_helpers: Add 'const' qualifiers to git_cred_userpass_payload
Make both username & password in git_cred_userpass_payload 'const'.
The values are not altered anywhere, and the extra qualifier allows
clients to assign 'const' values there.
2015-05-24 13:18:30 +02:00
Tony Kelman
2a3067765f build maint branches on appveyor
equivalent of ca183d2736
2015-05-22 14:02:44 -07:00
Carlos Martín Nieto
c11daac9de Merge pull request #3151 from ethomson/thinpack
Thin packs: don't
2015-05-22 22:12:40 +02:00
Edward Thomson
e2dd3735a5 indexer: avoid loading already existent bases
When thickening a pack, avoid loading already loaded bases and
trying to insert them all over again.
2015-05-22 15:27:52 -04:00
Edward Thomson
38c10ecd99 indexer: don't look for the index we're creating
When creating an index, know that we do not have an index for
our own packfile, preventing some unnecessary file opens and
error reporting.
2015-05-22 15:27:48 -04:00
Edward Thomson
2540487fcd Merge pull request #3108 from libgit2/cmn/ssl-no-want
openssl: don't try to handle WANT_READ or WANT_WRITE
2015-05-22 12:53:52 -04:00
Carlos Martín Nieto
ca183d2736 travis: build maint branches 2015-05-22 17:44:28 +02:00
Carlos Martín Nieto
5014fe95f5 branch: error out if we cannot find the remote
When we look for which remote corresponds to a remote-tracking branch,
we look in the refspecs to see which ones matches. If none do, we should
abort. We currently ignore the error message from this operation, so
let's not do that anymore.

As part of the test we're writing, let's test for the expected behaviour
if we cannot find a refspec which tells us what the remote-tracking
branch for a remote would look like.
2015-05-22 12:31:39 +02:00
Carlos Martín Nieto
7cd4ba1b17 refspec: make sure matching refspecs have src, dst and input strings
When we find out that we're dealing with a matching refspec, we set the
flag and return immediately. This leaves the strings as NULL, which
breaks the contract.

Assign these pointers to a string with the correct values.
2015-05-22 12:11:42 +02:00
Carlos Martín Nieto
a6ea108b56 Merge branch 'sni' 2015-05-21 14:04:46 +02:00
Cristian Oneț
987045c74a Call the openssl API to be able to work with SNI servers. 2015-05-21 14:03:44 +02:00
Carlos Martín Nieto
5d74fb7839 Merge pull request #3145 from stinb/fix_cxx_build
Fix error when building as C++.
2015-05-21 06:32:29 +02:00
Carlos Martín Nieto
6675aaba88 Merge pull request #3146 from ethomson/add_untracked_files
index_add_all: include untracked files in new subdirs
2015-05-21 04:58:16 +02:00
Edward Thomson
cbfeecf33f git_index_add_all: don't recurse ignored dirs
No need to get reports about individual ignored files, having a
single ignored directory delta is enough.
2015-05-20 20:14:31 -04:00
Edward Thomson
3e85be2bf1 Merge pull request #3144 from libgit2/cmn/ignored-ignore
ignore: clear the error when matching a pattern negation
2015-05-20 20:07:39 -04:00
Edward Thomson
fa9a969d80 index_add_all: include untracked files in new subdirs 2015-05-20 20:05:55 -04:00
Jason Haslam
d30155f2f9 Fix error when building as C++. 2015-05-20 14:26:05 -06:00
Carlos Martín Nieto
2c57114f11 ignore: clear the error when matching a pattern negation
When we discover that we want to keep a negative rule, make sure to
clear the error variable, as it we otherwise return whatever was left by
the previous loop iteration.
2015-05-20 21:49:02 +02:00
Carlos Martín Nieto
cd3f3c2844 Add a missing include for reset
Our doc parser really wants the types to be declared in the header it's
reading.
2015-05-20 21:06:01 +02:00
Carlos Martín Nieto
c06e180a98 Merge pull request #3137 from libgit2/cmn/server-errors
Improve server error reporting
2015-05-20 17:13:49 +02:00
Carlos Martín Nieto
1396c38178 errors: add GIT_EEOF to indicate early EOF
This can be used by tools to show mesages about failing to communicate
with the server. The error message in this case will often contain the
server's error message, as far as it managed to send anything.
2015-05-20 15:08:39 +02:00
Carlos Martín Nieto
e3435673b8 ssh: read from stderr if stdout is empty
When we fail to read from stdout, it's typically because the URL was
wrong and the server process has sent some output over its stderr
output.

Read that output and set the error message to whatever we read from it.
2015-05-20 15:08:39 +02:00
Edward Thomson
acc573cba3 Merge pull request #3109 from libgit2/cmn/index-use-diff
Use a diff for iteration in index_update_all and index_add_all
2015-05-19 14:12:40 -04:00
Edward Thomson
0aa603363e Merge pull request #3132 from libgit2/cmn/path-direach-cberror
Provide error messages for git_path_direach operations
2015-05-19 14:07:03 -04:00
Carlos Martín Nieto
edef91ee25 fileops: set an error on write error for file copy
We set an error if we get an error when reading, but we don't bother
setting an error message for write failing. This causes a cryptic error
to be shown to the user when the target filesystem is full.
2015-05-17 15:48:33 +02:00
Carlos Martín Nieto
70f7484d2a remote: get rid of the run-time refspec setters
These were left over from the culling as it's not clear which use-cases
might benefit from this. It is not clear that we want to support any
use-case which depends on changing the remote's idea of the base
refspecs rather than passing in different per-operation refspec list, so
remove these functions.
2015-05-17 15:45:37 +02:00
Carlos Martín Nieto
7b5ce2e5c4 clone: don't rely on auto-saving for single-branch
The code used to rely on the clone code calling the remote's save, which
does not happen anymore, meaning that the configuration settings the
remote expected were not being written to disk.

The run-time configuration was still being affected, so the right branch
was being cloned. The tests continued to pass as we did not check for
the configuration entires. Fix this by creating the remote with the
single-branch refspec we want and checking for its existence in the
configuration.
2015-05-17 15:45:37 +02:00
Carlos Martín Nieto
9663d1bd8b Fix typos in the CHANGELOG 2015-05-17 15:45:37 +02:00
Carlos Martín Nieto
54738368ec fileops: set an error message if we fail to link a file
Now that `git_path_direach` lets us specify an error message to report,
set an appropriate error message while linking.
2015-05-15 12:18:05 +02:00
Carlos Martín Nieto
8a4d77f990 path: don't let direach overwrite the callback's error message
This function deals with functions doing IO which means the amount of
errors that can happen is quit large. It does not help if it always
ovewrites the underlying error message with a less understandable
version of "something went wrong".

Instead, only use this generic message if there was no error set by the
callback.
2015-05-15 12:15:45 +02:00
Carlos Martín Nieto
9042693e28 Merge pull request #3130 from mortonfox/patch-1
Updated dlibgit link.
2015-05-15 10:10:24 +02:00
Yury G. Kudryashov
c8022e6ce7 Add const qualifier
This fixes a warning in `examples/describe.c` without breaking the main build.

OTOH, I'm not sure if this is an API-compatible change.
2015-05-15 00:34:43 +03:00
Carlos Martín Nieto
481ac3d1b3 Merge pull request #3129 from Therzok/patch-2
Bring Early EOF message in line with the other two
2015-05-14 21:51:45 +02:00
Morton Fox
e702dc2e24 Updated dlibgit link. 2015-05-14 15:49:51 -04:00
Marius Ungureanu
7e9a240e0a Make "Early EOF" message start with lowercase 2015-05-14 21:39:52 +03:00
Carlos Martín Nieto
542a7de0cd local: plug a leak in the progress reporting 2015-05-14 17:26:09 +02:00
Carlos Martín Nieto
874cc35a8d index: add a CHANGELOG entry for the diff usage 2015-05-14 15:24:15 +02:00
Carlos Martín Nieto
2b2dfe80f0 index: include TYPECHANGE in the diff
Without this option, we would not be able to catch exec bit changes.
2015-05-14 15:23:12 +02:00