Commit Graph

8268 Commits

Author SHA1 Message Date
Carlos Martín Nieto
81be2f467c 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.
2015-06-09 16:01:29 +02:00
Carlos Martín Nieto
2785544fb5 remote: some error-handling issues from Coverity 2015-06-07 10:45:39 +02:00
Carlos Martín Nieto
babdc376c7 Merge pull request #3172 from Therzok/patch-2
Change error when running out of ssh agent keys
2015-06-04 13:02:59 +02:00
Marius Ungureanu
d71e3b2532 Change error when running out of ssh agent keys 2015-06-02 12:32:19 +03:00
Carlos Martín Nieto
be5fda7587 Include git2/transaction.h
This was forgotten when the feature was implemented.
2015-05-31 19:22:12 +02:00
Carlos Martín Nieto
449f9ec97e Merge pull request #3152 from tkelman/patch-1
build maint branches on appveyor
2015-05-31 18:53:42 +02:00
Carlos Martín Nieto
ac587e7596 Merge pull request #3048 from pks-t/insteadof
Implementation of url.*.insteadOf
2015-05-31 15:45:56 +02:00
Patrick Steinhardt
9e88a823f6 remote: test insteadOf for anonymous remotes 2015-05-31 13:26:05 +02:00
Patrick Steinhardt
771069e1fb Add CHANGELOG entry for url.*.insteadOf feature. 2015-05-31 13:22:48 +02:00
Patrick Steinhardt
ec0c4c4001 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".
2015-05-31 13:21:53 +02:00
Carlos Martín Nieto
a5670d4f2d CHANGELOG: fill in a few missing entries 2015-05-29 20:09:46 +02:00
Carlos Martín Nieto
2c8550f040 Merge pull request #3157 from mgorny/ssh_memory_auth
Support getting SSH keys from memory, pt. 2
2015-05-29 19:38:11 +02:00
Carlos Martín Nieto
64be170d47 Merge pull request #3163 from ethomson/emergeconflict
Rename GIT_EMERGECONFLICT to GIT_ECONFLICT
2015-05-29 16:42:40 +02:00
Edward Thomson
885b94aac0 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.
2015-05-29 09:55:09 -04:00
Edward Thomson
41a71c1a5e Merge pull request #3161 from fxfactorial/master
Changed README to use new OCaml bindings to git
2015-05-28 16:29:52 -04:00
Edgar Aroutiounian
69560cc089 Changed README to use new OCaml bindings to git 2015-05-28 15:19:53 -04:00
Carlos Martín Nieto
ff8d635adb Merge pull request #3139 from ethomson/diff_conflicts
Include conflicts when diffing
2015-05-28 18:45:57 +02:00
Edward Thomson
fb92b48d54 Merge pull request #3149 from libgit2/cmn/upstream-matching-push
Fill the pointers for matching refspecs
2015-05-28 10:13:07 -04:00
Carlos Martín Nieto
2b92283221 Merge pull request #3127 from libgit2/cmn/remote-fixups
Tackle remote API issues from bindings
2015-05-28 16:09:17 +02:00
Edward Thomson
9b3e41f72b index_add_all: remove conflicts when no wd file
If there exists a conflict in the index, but no file in the working
directory, this implies that the user wants to accept the resolution
by removing the file.  Thus, remove the conflict entry from the
index, instead of trying to add a (nonexistent) file.
2015-05-28 09:47:51 -04:00
Edward Thomson
10549a2df1 Introduce GIT_DIFF_FLAG_EXISTS
Mark the `old_file` and `new_file` sides of a delta with a new bit,
`GIT_DIFF_FLAG_EXISTS`, that introduces that a particular side of
the delta exists in the diff.

This is useful for indicating whether a working directory item exists
or not, in the presence of a conflict.  Diff users may have previously
used DELETED to determine this information.
2015-05-28 09:47:47 -04:00
Edward Thomson
666ae18821 git_index_add_all: test that conflicts are handled
When confronted with a conflict in the index, `git_index_add_all`
should stage the working directory copy.  If there is no file in the
working directory, the conflict should simply be removed.
2015-05-28 09:47:43 -04:00
Edward Thomson
1c4b5cee00 Introduce cl_git_sandbox_init_new()
cl_git_sandbox_init_new() will create a clar temp directory and
initialize a new repository at that location.
2015-05-28 09:47:39 -04:00
Edward Thomson
253a05f76b diff: prettify maybe_modified a little 2015-05-28 09:47:35 -04:00
Edward Thomson
9f545b9d71 introduce git_index_entry_is_conflict
It's not always obvious the mapping between stage level and
conflict-ness.  More importantly, this can lead otherwise sane
people to write constructs like `if (!git_index_entry_stage(entry))`,
which (while technically correct) is unreadable.

Provide a nice method to help avoid such messy thinking.
2015-05-28 09:47:31 -04:00
Edward Thomson
2f1080ea04 conflict tests: use GIT_IDXENTRY_STAGE_SET 2015-05-28 09:44:22 -04:00
Edward Thomson
191e97a02b diff conflicts: don't include incorrect ID
Since a diff entry only concerns a single entry, zero the information
for the index side of a conflict.  (The index entry would otherwise
erroneously include the lowest-stage index entry - generally the
ancestor of a conflict.)

Test that during status, the index side of the conflict is empty.
2015-05-28 09:44:18 -04:00
Edward Thomson
b22369efa2 diff conflicts: test index to workdir w/ conflicts 2015-05-28 09:44:14 -04:00
Edward Thomson
bb815157da diff conflicts: add tests for tree to index 2015-05-28 09:44:10 -04:00
Edward Thomson
7877146fc2 diff: for conflicts w/o workdir, blank nitem side
Make sure that we provide a blanked nitem side when the item does not
exist in the working directory.
2015-05-28 09:44:06 -04:00
Edward Thomson
7c94801400 diff/status: introduce conflicts
When diffing against an index, return a new `GIT_DELTA_CONFLICTED`
delta type for items that are conflicted.  For a single file path,
only one delta will be produced (despite the fact that there are
multiple entries in the index).

Index iterators now have the (optional) ability to return conflicts
in the index.  Prior to this change, they would be omitted, and callers
(like diff) would omit conflicted index entries entirely.
2015-05-28 09:44:02 -04:00
Edward Thomson
d67f270e58 index: validate mode of new conflicts 2015-05-28 09:43:57 -04:00
Edward Thomson
3ab5a65967 index: remove error message in non-error remove
If `git_index_remove_bypath` does no work, and returns an OK error
code, it should not set an error message.
2015-05-28 09:43:53 -04:00
Edward Thomson
ecd60a56eb conflicts: when adding conflicts, remove staged
When adding a conflict for some path, remove the staged entry.
Otherwise, an illegal index (with both stage 0 and high-stage
entries) would result.
2015-05-28 09:43:49 -04:00
Edward Thomson
1b6c26db97 diff: wrap the iterator functions
Wrap the iterator current / advance functions so that we can extend
them, but also handle GIT_ITEROVER cases in the iterator funcs
instead of the callers.
2015-05-28 09:43:45 -04:00
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
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