Commit Graph

1291 Commits

Author SHA1 Message Date
Edward Thomson
bc8c4a8aeb Merge pull request #2695 from libgit2/cmn/remote-lookup
remote: rename _load() to _lookup()
2014-11-08 16:55:23 -05:00
Edward Thomson
e3bd48a793 Merge pull request #2696 from libgit2/cmn/empty-objects
odb: hardcode the empty blob and tree
2014-11-08 16:52:43 -05:00
Carlos Martín Nieto
e1ac010148 odb: hardcode the empty blob and tree
git hardocodes these as objects which exist regardless of whether they
are in the odb and uses them in the shell interface as a way of
expressing the lack of a blob or tree for one side of e.g. a diff.

In the library we use each language's natural way of declaring a lack of
value which makes a workaround like this unnecessary. Since git uses it,
it does however mean each shell application would need to perform this
check themselves.

This makes it common work across a range of applications and an issue
with compatibility with git, which fits right into what the library aims
to provide.

Thus we introduce the hard-coded empty blob and tree in the odb
frontend. These hard-coded objects are checked for before going to the
backends, but after the cache check, which means the second time they're
used, they will be treated as normal cached objects instead of creating
new ones.
2014-11-08 20:53:38 +01:00
Carlos Martín Nieto
64fdd86d0e remote: don't check for upstream on an anonymous remote
If the remote is anonymous, then we cannot check for any configuration,
as there is no name. Check for this before we try to use the name, which
may be a NULL pointer.

This fixes #2697.
2014-11-08 20:21:14 +01:00
Carlos Martín Nieto
82374d9825 branch: add getter for the upstream remote name
This gets the value from branch.<foo>.remote.
2014-11-08 20:00:17 +01:00
Carlos Martín Nieto
209425ce26 remote: rename _load() to _lookup()
This brings it in line with the rest of the lookup functions.
2014-11-08 13:28:27 +01:00
Ungureanu Marius
6818208569 git_status_file now takes an exact path
This function has one output but can match multiple files, which can be
unexpected for the user, which would usually path the exact path of the
file he wants the status of.
2014-11-07 21:34:54 +02:00
Carlos Martín Nieto
62a617dc68 iterator: submodules are determined by an index or tree
We cannot know from looking at .gitmodules whether a directory is a
submodule or not. We need the index or tree we are comparing against to
tell us. Otherwise we have to assume the entry in .gitmodules is stale
or otherwise invalid.

Thus we pass the index of the repository into the workdir iterator, even
if we do not want to compare against it. This follows what git does,
which even for `git diff <tree>`, it will consider staged submodules as
such.
2014-11-07 08:33:27 +01:00
Carlos Martín Nieto
f1a7906fdf submodules: add failing test for stale module entries
We consider an entry in .gitmodules to mean that we have a submodule at
a particular path, even if HEAD^{tree} and the index do not contain any
reference to it.

We should ignore that submodule entry and simply consider that path to
be a regular directory.
2014-11-07 08:33:27 +01:00
Edward Thomson
2d24816b46 checkout_index: Remove stage 0 when checking out conflicts 2014-11-06 18:50:10 -05:00
Edward Thomson
9f664347ff checkout_index: remove conflicts when checking out new files 2014-11-06 18:49:57 -05:00
Edward Thomson
64dc248577 Merge pull request #2598 from libgit2/cmn/stacked-ignore
ignore: don't leak rules into higher directores
2014-11-06 10:38:25 -05:00
Edward Thomson
f890a84fe0 Merge pull request #2682 from libgit2/cmn/fetch-tags-refspec
remote: check for the validity of the refspec when updating FETCH_HEAD
2014-11-06 10:19:22 -05:00
Carlos Martín Nieto
0798b01400 ignore: add failing test for a file mentioning the parent
When we mention "src" in src/.gitignore, we wrongly consider src/ itself
to be ignored.
2014-11-06 10:10:26 +01:00
Edward Thomson
b4e5432ff0 Merge pull request #2688 from libgit2/cmn/ignore-file-trailing-cr
ignore: consider files with a CR in their names
2014-11-05 10:47:19 -05:00
Carlos Martín Nieto
5c54e2162a ignore: consider files with a CR in their names
We currently consider CR to start the end of the line, but that means
that we miss cases with CR CR LF which can be used with git to match
files whose names have CR at the end of their names.

The fix from the patch comes from Russell's comment in the issue.

This fixes #2536.
2014-11-05 16:22:01 +01:00
Edward Thomson
cce27d8242 git_remote_rename: propogate GIT_ENOTFOUND 2014-11-03 14:10:31 -05:00
Edward Thomson
de0c4555da Merge pull request #2679 from jfultz/missing-include
Make config reading continue after hitting a missing include file.
2014-11-03 11:32:47 -05:00
John Fultz
ebc13b2b7c Clean up issues include.path issues found during code review.
* Error-handling is cleaned up to only let a file-not-found error
  through, not other sorts of errors.  And when a file-not-found
  error happens, we clean up the error.
* Test now checks that file-not-found introduces no error.  And
  other minor cleanups.
2014-11-02 19:16:49 -06:00
Carlos Martín Nieto
ea8dedc953 remote: fix tagopt test
An anonymous remote wouldn't create remote-tracking branches, so testing
we don't create them for TAGS_ALL is nonsensical. Furthermore, the name
of the supposed remote-tracking branch was also not one which would have
been created had it had a name.

Give the remote a name and test that we only create the tags when we
pass TAGS_ALL and that we do create the remote-branch branch when given
TAGS_AUTO.
2014-11-02 20:39:29 +01:00
Carlos Martín Nieto
0f838d27f1 remote: add a failing test for checking the current branch's upstream
When we update FETCH_HEAD we check whether the remote is the current
branch's upstream remote. The code does not check whether the current
refspec is relevant for this reference but always tries to perform the
reverse transformation, which causes it to error out if the refspec
doesn't match the reference.

Thanks to Pierre-Olivier Latour for the reproduction recipe.
2014-11-02 20:03:23 +01:00
John Fultz
727ae380a5 Make config reading continue after hitting a missing include file.
For example, if you have

[include]
path = foo

and foo didn't exist, git_config_open_ondisk() would just give up
on the rest of the file.  Now it ignores the unresolved include
without error and continues reading the rest of the file.
2014-11-01 11:21:45 -05:00
Edward Thomson
53ca45ee25 revert tests: always use core.autocrlf=false in tests 2014-10-27 17:27:25 -04:00
Edward Thomson
18b00406c6 s/git_merge_head/git_annotated_commit
Rename git_merge_head to git_annotated_commit, as it becomes used
in more operations than just merge.
2014-10-26 22:59:48 -04:00
Edward Thomson
796b03bd49 rebase: clean up some warnings and memory leaks 2014-10-26 22:59:46 -04:00
Edward Thomson
ed2c06a6a1 git_rebase: iterators for operations 2014-10-26 22:59:41 -04:00
Edward Thomson
f152f8ac0c rebase: preload all operations 2014-10-26 22:59:38 -04:00
Edward Thomson
b6b636a7fa rebase: init/open a git_rebase object 2014-10-26 22:59:36 -04:00
Edward Thomson
18b439b9be git_rebase_next: provide info about the operation 2014-10-26 22:59:34 -04:00
Edward Thomson
5ae9d296e3 git_rebase_finish: rewrite notes when finishing rebase 2014-10-26 22:59:32 -04:00
Edward Thomson
a612a25fa6 git_rebase_commit: write HEAD's reflog appropriately 2014-10-26 22:59:27 -04:00
Edward Thomson
517644cce4 Introduce git_rebase_finish to complete a rebase 2014-10-26 22:59:25 -04:00
Edward Thomson
14864fbfeb git_rebase_next: test that we return GIT_ITEROVER 2014-10-26 22:59:23 -04:00
Edward Thomson
93a7004cc2 git_rebase_commit: drop already-picked commits
Already cherry-picked commits should not be re-included.  If all changes
included in a commit exist in the upstream, then we should error with
GIT_EAPPLIED.
2014-10-26 22:59:21 -04:00
Edward Thomson
a35a9890b0 Introduce git_rebase_commit
Commit the current patch of a rebase process.
2014-10-26 22:59:19 -04:00
Edward Thomson
443d5674fe git_rebase_next: write conflicts nicely during rebase 2014-10-26 22:59:16 -04:00
Edward Thomson
950a709159 Introduce git_rebase_next
`git_rebase_next` will apply the next patch (or cherry-pick)
operation, leaving the results checked out in the index / working
directory so that consumers can resolve any conflicts, as appropriate.
2014-10-26 22:59:14 -04:00
Edward Thomson
4fe84d624b Introduce git_rebase_abort
Abort an in-progress rebase and move the working directory and
repository back to the ORIG_HEAD state.
2014-10-26 22:59:12 -04:00
Edward Thomson
867a36f3a6 Introduce git_rebase to set up a rebase session
Introduce `git_rebase` to set up a rebase session that can
then be continued.  Immediately, only merge-type rebase is
supported.
2014-10-26 22:59:08 -04:00
Edward Thomson
4b1b2bd9eb revwalk::mergebase test: free memory 2014-10-26 22:27:58 -04:00
Edward Thomson
e4985fe3a9 submodule test: free submodule 2014-10-26 22:27:54 -04:00
Edward Thomson
16288d2db3 clone::local test: isalpha -> git__isalpha 2014-10-26 22:27:50 -04:00
Edward Thomson
90aa2bf39b config test: clean up memory leak 2014-10-26 22:27:48 -04:00
Edward Thomson
cdd71711ce Clean up some memory leaks 2014-10-26 22:27:44 -04:00
Carlos Martín Nieto
fad0aea9fe tests: fix leak 2014-10-27 01:47:40 +01:00
Linquize
9223f2884c Fix test repo dir not deleted after running 2014-10-27 01:06:28 +08:00
Linquize
81f1fc7142 Fix missing object in tests/resources/crlf by changing the tail commit 2014-10-26 11:41:01 +08:00
Edward Thomson
d09458f3e9 Merge pull request #2638 from libgit2/cmn/config-refresh-remove
config: remove the refresh function and backend field
2014-10-24 16:52:39 -07:00
Edward Thomson
725cd5f29d Merge pull request #2646 from libgit2/cmn/remote-rename
remote: accept a repo and name for renaming
2014-10-24 16:44:07 -07:00
Edward Thomson
a747ea49c9 Merge pull request #2647 from ethomson/clar_tmpname
clar: use a custom temp directory name
2014-10-24 14:01:13 -07:00
Edward Thomson
29eed1c74d clar: use a custom temp directory name 2014-10-24 10:50:57 -04:00
Carlos Martín Nieto
46c8f7f845 remote: accept a repo and name for renaming
Remote objects are not meant to be changed from under the user. We did
this in rename, but only the name and left the refspecs, such that a
save would save the wrong refspecs (and a fetch and anything else would
use the wrong refspecs).

Instead, let's simply take a name and not change any loaded remote from
under the user.
2014-10-24 16:25:59 +02:00
Carlos Martín Nieto
0862f617da remote: delete git_remote_supported_url()
This function does not in fact tell us anything, as almost anything with
a colon in it is a valid rsync-style SSH path; it can not tell us that
we do not support ftp or afp or similar as those are still valid SSH
paths and we do support that.
2014-10-24 13:40:42 +02:00
Carlos Martín Nieto
55cb499972 config: remove the refresh function and backend field
We have been refreshing on read and write for a while now, so
git_config_refresh() is at best a no-op, and might just end up wasting
cycles.
2014-10-23 19:05:02 +02:00
Carlos Martín Nieto
4bb6ffb6bb Merge pull request #2622 from libgit2/refresh-config-snapshot
Refresh git configuration before looking for the tracking branch redux.
2014-10-23 18:58:39 +02:00
Alan Rogers
1e2fe921a5 Change the length of the file so that the change is picked up. 2014-10-23 15:21:29 +11:00
Alan Rogers
5490c9d470 Add a test to make sure a new snapshot has the new value. 2014-10-23 15:21:04 +11:00
Edward Thomson
12f32d9193 Remote paths: canonicalize UNC paths on Win32
Git for Windows will handle UNC paths only when in forward-slash
format, eg "//server/path".  When given a UNC path as a remote,
rewrite standard format ("\\server\path") into this ridiculous
format.
2014-10-22 17:49:53 -04:00
Carlos Martín Nieto
bb0757d56c tree-cache: correct the entry_count calculation
The entry_count field is the amount of index entries covered by a
particular cache entry, that is how many files are there (recursively)
under a particular directory.

The current code that attemps to do this is severely defincient and is
trying to count the amount of children, which always comes up to zero.

We don't even need to recount, since we have the information during the
cache creation. We can take that number and keep it, as we only ever
invalidate or replace.
2014-10-22 21:25:08 +02:00
Edward Thomson
8d3b2ee3d7 Introduce failing test for conflict filtering in index 2014-10-13 13:36:16 -04:00
Russell Belfer
85fe63bc58 Don't use cl_git_pass for POSIX functions
If there is a failure then cl_git_pass tries to get the libgit2
error, but p_... functions don't set that.

Also - trailing whitespace cleanup.
2014-10-10 15:17:27 -07:00
Carlos Martín Nieto
795d8e9328 index: make sure to write cached subtrees if parent is invalidated
If e.g. the root tree is invalidated, we still want to write out
its children, since those may still have valid cache entries.
2014-10-10 19:43:42 +02:00
Carlos Martín Nieto
c2f8b21593 index: write out the tree cache extension
Keeping the cache around after read-tree is only one part of the
optimisation opportunities. In order to share the cache between program
instances, we need to write the TREE extension to the index.

Do so, taking the opportunity to rename 'entries' to 'entry_count' to
match the name given in the format description. The included test is
rather trivial, but works as a sanity check.
2014-10-10 19:43:42 +02:00
Carlos Martín Nieto
ee4db1c16e index: add tests for the tree cache
These test that we invalidate at the right levels and that we remove the
tree cache when clearing the index.
2014-10-10 19:35:19 +02:00
Edward Thomson
a6ed1fcbe1 Merge pull request #2593 from libgit2/cmn/remote-delete-name
remote: accept a repository and remote name for deletion
2014-10-10 12:21:28 -04:00
Carlos Martín Nieto
942a7b39ed Fix test build
Some PRs have fallen out of sync with the changes in signatures, so we
need to take a few extra parameters into account.
2014-10-10 18:03:09 +02:00
Carlos Martín Nieto
2139c9b76c Merge pull request #2542 from linquize/fetch-head
Do not error out when fetching from second remote
2014-10-10 17:50:28 +02:00
Carlos Martín Nieto
0625638f06 Merge pull request #2499 from csware/hard-reset-checkout-callbacks
Allow to propagate checkout callbacks to git HARD reset
2014-10-10 17:40:53 +02:00
Edward Thomson
f54d8d528a Merge pull request #2574 from csware/hostname-for-certificate_check_cb
Provide host name to certificate_check_cb
2014-10-10 11:28:58 -04:00
Edward Thomson
533da4ea00 Merge pull request #2473 from arthurschreiber/arthur/new-javascript-test-files
New test files for the javascript diff driver.
2014-10-10 10:03:06 -04:00
Carlos Martín Nieto
46a2b8e855 Merge pull request #2592 from libgit2/cmn/describe
Implement git-describe
2014-10-09 22:24:40 +02:00
Arthur Schreiber
994a3006b6 Update the javascript diff driver's function pattern. 2014-10-09 22:21:34 +02:00
Arthur Schreiber
19fa9c0ca0 New test files for the javascript diff driver. 2014-10-09 22:14:55 +02:00
Edward Thomson
dfff1b5bcb Merge pull request #2599 from linquize/config-trailing-spaces
config: Handle multiple spaces that follow a configuration value and precede a comment char
2014-10-09 12:16:17 -04:00
Sven Strickroth
db3d169c33 Add tests for host names
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2014-10-09 17:32:38 +02:00
Edward Thomson
8371457ce2 Merge pull request #2597 from ethomson/fixup
Trivial fixups
2014-10-09 11:32:26 -04:00
Edward Thomson
10cf4b26a0 Merge pull request #2448 from libgit2/cmn/reference-transaction
Introduce reference transactions
2014-10-09 10:49:37 -04:00
Edward Thomson
8be28acfcd Merge pull request #2462 from libgit2/cmn/remote-fetch-refs
Implement opportunistic ref updates
2014-10-09 10:41:38 -04:00
Carlos Martín Nieto
c327d5db8b transaction: rename lock() to lock_ref()
This leaves space for future expansion to locking other resources
without having to change the API for references.
2014-10-09 16:29:30 +02:00
Arthur Schreiber
eca07bcd83 Add git_merge_bases_many. 2014-10-09 14:19:00 +02:00
Linquize
a447a7e40b config: Add test cases that have trailing spaces before comment chars 2014-10-04 23:28:40 +08:00
Edward Thomson
ca7cd1734d p_mkdir != mkdir on win32 2014-10-03 19:30:48 -04:00
Vicent Marti
737b505116 hashsig: Export as a sys header 2014-10-01 12:03:24 +02:00
Carlos Martín Nieto
262eec23fe remote: accept a repository and remote name for deletion
We don't need the remote loaded, and the function extracted both of
these from the git_remote in order to do its work, so let's remote a
step and not ask for the loaded remote at all.

This fixes #2390.
2014-09-30 16:09:55 +02:00
Carlos Martín Nieto
ab8d9242f5 Introduce reference transactions
A transaction allows you to lock multiple references and set up changes
for them before applying the changes all at once (or as close as the
backend supports).

This can be used for replication purposes, or for making sure some
operations run when the reference is locked and thus cannot be changed.
2014-09-30 15:44:32 +02:00
Carlos Martín Nieto
c5837cad85 remote: implement opportunistic remote-tracking branch updates
When a list of refspecs is passed to fetch (what git would consider
refspec passed on the command-line), we not only need to perform the
updates described in that refspec, but also update the remote-tracking
branch of the fetched remote heads according to the remote's configured
refspecs.

These "fetches" are not however to be written to FETCH_HEAD as they
would be duplicate data, and it's not what the user asked for.
2014-09-30 15:43:24 +02:00
Carlos Martín Nieto
9c206a2248 remote: use active refspec override in the tests
This lets us test this bit as well as getting closer to what they were
trying to do.
2014-09-30 15:42:32 +02:00
Carlos Martín Nieto
3f89420523 remote: allow overriding the refspecs for download and fetch
With opportunistic ref updates, git has introduced the concept of having
base refspecs *and* refspecs that are active for a particular fetch.

Let's start by letting the user override the refspecs for download.
2014-09-30 15:42:32 +02:00
Carlos Martín Nieto
25345c0cbe describe: rename git_describe_opts to git_describe_options
And implement the option init functions for this and the format options.
2014-09-30 09:18:22 +02:00
Carlos Martín Nieto
5431c46a96 describe: use globs in the tests
This makes us be closer to git's tests, and lets us better describe what
we expect from the output.
2014-09-30 09:05:55 +02:00
Carlos Martín Nieto
fd8126e4c6 describe: implement describing the workdir
When we describe the workdir, we perform a describe on HEAD and then
check to see if the worktree is dirty. If it is and we have a suffix
string, we append that to the buffer.
2014-09-30 08:56:20 +02:00
Carlos Martín Nieto
3b6534b807 describe: split into gather and format steps
Instead of printing out to the buffer inside the information-gathering
phase, write the data to a intermediate result structure.

This allows us to split the options into gathering options and
formatting options, simplifying the gathering code.
2014-09-30 07:24:28 +02:00
Carlos Martín Nieto
1f501a086b describe: rename _object() to _commit()
We don't describe arbitrary object, so let's give it the name of the one
object type we accept.
2014-09-30 04:58:02 +02:00
Carlos Martín Nieto
af6cc38fc0 Merge remote-tracking branch 'upstream/master' into cmn/describe 2014-09-30 04:38:05 +02:00
Edward Thomson
4c53489260 Merge pull request #2581 from jacquesg/stash-ignored-directories
Stash ignored directories
2014-09-29 14:57:54 -04:00
Edward Thomson
89602a1a23 Merge pull request #2584 from jacquesg/pool-alignment
Pool/Index data is not aligned
2014-09-29 10:39:40 -04:00
Edward Thomson
ced843f417 Merge pull request #2559 from libgit2/cmn/free-tls-error
global: free the error message when exiting a thread
2014-09-29 10:29:00 -04:00
Jacques Germishuys
0478b7f472 Silence unused return value warning 2014-09-26 12:12:09 +02:00
Jakub Čajka
7629ea5d8d Fixed odb foreach test failure for big-endian 64-bit 2014-09-26 12:12:08 +02:00
Jakub Čajka
d99e547173 Fixed merge REUC test for big-endian 64-bit 2014-09-26 12:12:08 +02:00
Jacques Germishuys
940da54861 Added test for stashing files in ignored directories 2014-09-24 13:24:06 +02:00
Sven Strickroth
e6e834a129 Provide host name to certificate_check_cb
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2014-09-22 16:27:52 +02:00
Vicent Marti
14556cbff7 Merge pull request #2567 from cirosantilli/factor-41
Factor 40 and 41 constants from source.
2014-09-17 17:13:25 +02:00
Vicent Marti
276d9ea3a6 Merge pull request #2571 from libgit2/vmg/walk-up-path
Fix `git_path_walk_up` to work with non-rooted paths
2014-09-17 15:39:57 +02:00
Vicent Marti
4592b62ee5 Merge pull request #2572 from cirosantilli/factor-void
Replace void casts with GIT_UNUSED.
2014-09-17 15:26:48 +02:00
Ciro Santilli
c5cf8cade3 Replace void casts with GIT_UNUSED. 2014-09-17 15:19:08 +02:00
The rugged tests are fragile
4cb7c4a4c7 attr: Add an extra test for files under a subfolder 2014-09-17 15:08:16 +02:00
The rugged tests are fragile
bbb988a519 path: Fix git_path_walk_up to work with non-rooted paths 2014-09-17 15:00:12 +02:00
Vicent Marti
1312f87b68 Merge pull request #2464 from libgit2/cmn/host-cert-info
Provide a callback for certificate validation
2014-09-17 14:56:39 +02:00
Carlos Martín Nieto
25abbc27a7 Clean up some leaks in the test suite 2014-09-17 03:19:40 +02:00
Carlos Martín Nieto
52e09724fd ssh: skip the localhost cert check earlier
Skip it before we attempt to clone, as we would exit with -1 on systems
which do not have sshd running.
2014-09-16 17:13:58 +02:00
Carlos Martín Nieto
1e0aa105fa ssh: expose both hashes
The user may have the data hashed as MD5 or SHA-1, so we should provide
both types for consumption.
2014-09-16 17:02:33 +02:00
Carlos Martín Nieto
286369a81f ssh: provide our own types for host key lengths
Instead of using the libssh2 defines, provide our own, which eases usage
as we do not need to check whether libgit2 was built with libssh2 or not.
2014-09-16 17:02:32 +02:00
Carlos Martín Nieto
0782fc43f8 net: use only structs to pass information about cert
Instead of spreading the data in function arguments, some of which
aren't used for ssh and having a struct only for ssh, use a struct for
both, using a common parent to pass to the callback.
2014-09-16 17:02:32 +02:00
Carlos Martín Nieto
0fef38999a Merge remote-tracking branch 'upstream/master' into cmn/host-cert-info 2014-09-16 17:02:28 +02:00
Carlos Martín Nieto
bf8756d6a2 ssh: add test for host key
Test that the certificate check callback gets the right fingerprint from
the host we're connecting to.
2014-09-16 17:01:32 +02:00
Carlos Martín Nieto
08545d366b winhttp: credential check on successful connect
On successful connection, still ask the user whether they accept the server's certificate, indicating that WinHTTP would let it though.
2014-09-16 17:01:31 +02:00
Carlos Martín Nieto
23ca0ad5eb Bring certificate check back to the normal return code
Returning 0 lets the certificate check succeed. An error code is bubbled
up to the user.
2014-09-16 17:01:31 +02:00
Carlos Martín Nieto
2f5864c50c ssh: do ssh cert info before asking for credentials
We know the host's key as soon as we connect, so we should perform the
check as soon as we can, before we bother with the user's credentials.
2014-09-16 17:01:31 +02:00
Carlos Martín Nieto
17491f6e56 transport: always call the certificate check callback
We should let the user decide whether to cancel the connection or not
regardless of whether our checks have decided that the certificate is
fine. We provide our own assessment to the callback to let the user fall
back to our checks if they so desire.
2014-09-16 17:01:30 +02:00
Carlos Martín Nieto
85acc56262 remote: add tests for the certificate callback 2014-09-16 17:01:30 +02:00
Carlos Martín Nieto
9b9405865e Provide a callback for certificate validation
If the certificate validation fails (or always in the case of ssh),
let the user decide whether to allow the connection.

The data structure passed to the user is the native certificate
information from the underlying implementation, namely OpenSSL or
WinHTTP.
2014-09-16 17:01:30 +02:00
Vicent Marti
903a76168e Merge pull request #2561 from jacquesg/merge-skip
No files merged may result in bogus merge conflict error
2014-09-16 13:22:40 +02:00
Ciro Santilli
3b2cb2c91e Factor 40 and 41 constants from source. 2014-09-16 13:07:04 +02:00
Russell Belfer
1fbeb2f04c Fix attribute lookup in index for bare repos
When using a bare repo with an index, libgit2 attempts to read
files from the index.  It caches those files based on the path
to the file, specifically the path to the directory that contains
the file.

If there is no working directory, we use `git_path_dirname_r` to
get the path to the containing directory.  However, for the
`.gitattributes` file in the root of the repository, this ends up
normalizing the containing path to `"."` instead of the empty
string and the lookup the `.gitattributes` data fails.

This adds a test of attribute lookups on bare repos and also
fixes the problem by simply rewriting `"."` to be `""`.
2014-09-15 21:59:23 -07:00
Vicent Marti
a7fcac13a5 Merge pull request #2554 from linquize/fetch-head-tag
When auto follow tags, FETCH_HEAD should list only newly followed tags
2014-09-15 20:26:12 +02:00
Carlos Martín Nieto
fdea219a86 global: free the error message when exiting a thread
When we free the global state at thread termination, we must also free
the error message in order not to leak the string once per thread.
2014-09-14 00:39:07 +02:00
Jacques Germishuys
493c340cef Added test case to illustrate bogus conflicts detected if no files were merged, and untracked files exist in the workdir. 2014-09-12 22:01:22 +02:00
Carlos Martín Nieto
76e3c43fb9 signature: don't allow empty emails
A signature is made up of a non-empty name and a non-empty email so
let's validate that. This also brings us more in line with git, which
also rejects ident with an empty email.
2014-09-10 18:14:46 +02:00
Vicent Marti
31e752b654 Merge pull request #2511 from libgit2/cmn/remote-default-restrict
Restrict which refs can be the default branch
2014-09-09 12:52:36 +02:00
Linquize
d908351a6c When auto follow tags, FETCH_HEAD should list only newly followed tags 2014-09-06 00:26:56 +08:00
Vicent Marti
89e05e2ab1 Merge pull request #2543 from libgit2/cmn/known-transports
Clean up transport lookup
2014-09-03 12:50:44 +02:00
Jameson Miller
bc737620dd Introduce option to use relative paths for repository work directory
Teach git_repository_init_ext to use relative paths for the gitlink
to the work directory. This is used when creating a sub repository
where the sub repository resides in the parent repository's
.git directory.
2014-09-02 21:07:26 -04:00
Edward Thomson
0ee9f31c3b Introduce git_path_make_relative 2014-09-02 21:07:23 -04:00
Vicent Marti
0ac9f9a0c7 Merge pull request #2545 from linquize/no-ssh
Skip SSH clone tests if libgit2 not built with GIT_SSH defined
2014-09-03 00:13:23 +02:00
Linquize
8deea5899d Add network::fetchlocal multi remotes test 2014-09-02 21:28:21 +08:00
Carlos Martín Nieto
15c30b72e1 clone: handle overly restrictive refspecs
When the fetch refspec does not include the remote's default branch, it
indicates an error in user expectations or programmer error. Error out
in that case.

This lets us get rid of the dummy refspec which can never work as its
zeroed out. In the cases where we did not find a default branch, we set
HEAD detached immediately, which lets us refactor the "normal" path,
removing `found_branch`.
2014-09-02 13:23:54 +02:00
Carlos Martín Nieto
e128a1af6e clone: correct handling of an unborn HEAD
If the remote does not advertise HEAD, then it is unborn and we cannot
checkout that branch. Handle it the same way as an empty repo.
2014-09-02 13:10:19 +02:00
Carlos Martín Nieto
538f908175 remote: add test for single-branch clone
When cloning, we may be asking for a particular branch or subset of
branches. Make sure we test for that.
2014-09-02 12:47:12 +02:00
Carlos Martín Nieto
f2ffab618a remote: add tests for remote-branch edge cases
Add tests for the case when there are no branches on the remote and when
HEAD is detached but has the id of a non-branch. In both of these cases,
we should return ENOTFOUND.
2014-09-02 12:47:12 +02:00
Linquize
fe3b67891b Skip SSH clone tests if libgit2 not built with GIT_SSH defined 2014-09-01 19:18:20 +08:00
Carlos Martín Nieto
05ac70514f remote: test for supported URLs in a single place
Instead of using ifdefs to run the tests, use them to set when we expect
to support a particular scheme and always have the tests in the code.
2014-08-31 21:53:42 +02:00
Carlos Martín Nieto
ba67c07522 remote: get rid of git_remote_valid_url()
It does the same as git_remote_supported_url() but has a name which
implies we'd check the URL for correctness while we're simply looking at
the scheme and looking it up in our lists.

While here, fix up the tests so we check all the combination of what's
supported.
2014-08-31 21:50:28 +02:00
Linquize
aff7001825 MSVC does not support zero size array 2014-08-31 22:43:53 +08:00
Vicent Marti
46a13f3247 Merge pull request #2481 from libgit2/cmn/oidarray
merge: expose multiple merge bases
2014-08-29 18:19:56 +02:00
Carlos Martín Nieto
94412b009e remote: assert what we want to happen when ther is no default branch
Assert what we already do, so as to notice changes.
2014-08-29 15:28:10 +02:00
Vicent Marti
d99c8ca178 Merge pull request #2539 from libgit2/cmn/ahead-behind-order
Fix ahead-behind results
2014-08-28 16:33:53 +02:00
Carlos Martín Nieto
e07aebb4e2 Fix ahead-behind tests
The logic was reversed. I have checked manually each pair with git and
adjusted the expectation to what git status prints.
2014-08-28 13:34:42 +02:00
Vicent Marti
69db893427 Merge pull request #2538 from libgit2/ntk/propagate_url_parsing_error
winhttp: Prevent swallowing of url parsing error
2014-08-27 19:19:55 +02:00
Vicent Marti
1485c6833a Merge pull request #2490 from csware/ssh-wintunnel
Allow to override default ssh transport_cb - in order to allow third party ssh transports
2014-08-27 18:02:10 +02:00
nulltoken
f0c53d21a4 winhttp: Prevent swallowing of url parsing error 2014-08-27 17:37:29 +02:00
Sven Strickroth
0e5bb61992 Added some tests
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2014-08-27 17:27:07 +02:00
Carlos Martín Nieto
c13b68442f Adjust clone tests to USERNAME cred type 2014-08-27 15:25:46 +02:00
Carlos Martín Nieto
6a0d2b43ee Merge remote-tracking branch 'upstream/master' into cmn/ssh-retry 2014-08-27 15:09:07 +02:00
Vicent Marti
00e9ae5ab4 Merge pull request #2508 from libgit2/rb/fix-ignore-slash-star
Fix bugs with negative ignores inside an ignored parent directory
2014-08-26 17:48:20 +02:00
Vicent Marti
5af52c628b Merge pull request #2531 from libgit2/rb/mkdir-allow-parent-failures
Allow mkdir helper to skip parent errors
2014-08-25 21:04:09 +02:00
Vicent Marti
2c1de697e0 Merge pull request #2527 from jacquesg/refspec-crash
Check if the refspec matches before transforming
2014-08-25 18:18:06 +02:00
Russell Belfer
668ae2ddf8 Allow mkdir helper to skip parent errors
Our mkdir helper was failing is a parent directory was not
accessible even if the child directory could be created.
This changes the helper to keep trying child directories
even when the parent is unwritable.
2014-08-22 10:05:09 -07:00
Vicent Marti
d28b2b7a5f Merge pull request #2528 from libgit2/vmg/tostr_s
Export `git_oid_tostr_s` instead of `_allocfmt`
2014-08-18 15:18:59 +02:00
Vicent Marti
43ebca8d7b Revert "test: Remove symlinks from the source tree"
This reverts commit 0dc54e1494.
2014-08-18 15:18:47 +02:00
Vicent Marti
0dc54e1494 test: Remove symlinks from the source tree
We don't really use this at all, and it breaks packaging in Windows.
2014-08-18 12:47:16 +02:00
Vicent Marti
4ca0b566ca oid: Export git_oid_tostr_s instead of _allocfmt
The old `allocfmt` is of no use to callers, as they are not able to free
the returned buffer. Export a new API that returns a static string that
doesn't need to be freed.
2014-08-18 12:41:06 +02:00
Jacques Germishuys
4e53c28096 Check if the refspec matches before transforming 2014-08-17 14:55:06 +02:00
Jacques Germishuys
dc8adda4f1 git_remote_ls() should return an error if the transport is not available 2014-08-15 22:56:15 +02:00
Edward Thomson
e003f83a58 Introduce git_buf_decode_base64
Decode base64-encoded text into a git_buf
2014-08-15 11:12:42 -04:00
Edward Thomson
adcdeb36b0 online::clone::credentials support default credentials 2014-08-15 11:12:42 -04:00
Edward Thomson
f96e7e6c94 Free references during push validation 2014-08-15 11:12:42 -04:00
Edward Thomson
0f29e96793 Remove the refs/notes/commits that we push in test
The online::push::notes test pushes a note but leaves it hanging
around for other tests to stumble across when they're validating
that they're seeing the refs they expect to see.  Clean it up on
exit.
2014-08-14 10:18:21 -05:00
Edward Thomson
aea676336c Don't run the ssh clone tests against http remotes 2014-08-14 10:18:20 -05:00
Vicent Marti
fb48a51c63 Merge pull request #2469 from ethomson/transport2
Custom transport: minor cleanups
2014-08-14 17:01:02 +02:00
Edward Thomson
c180c06586 Custom transport: minor cleanups
* Move the transport registration mechanisms into a new header under
   'sys/' because this is advanced stuff.
 * Remove the 'priority' argument from the registration as it adds
   unnecessary complexity.  (Since transports cannot decline to operate,
   only the highest priority transport is ever executed.)  Users who
   require per-priority transports can implement that in their custom
   transport themselves.
 * Simplify registration further by taking a scheme (eg "http") instead
   of a prefix (eg "http://").
2014-08-14 08:52:20 -05:00
Edward Thomson
c8402334d2 Don't include the unreadable tests on win32 2014-08-13 17:23:07 -04:00
Carlos Martín Nieto
9dac1f9579 config: a multiline var can start immediately
In the check for multiline, we traverse the backslashes from the end
backwards and int the end assert that we haven't gone past the beginning
of the line. We make sure of this in the loop condition, but we also
check in the return value.

However, for certain configurations, a line in a multiline variable
might be empty to aid formatting. In that case, 'end' == 'start', since
we ended up looking at the first char which made it a multiline.

There is no need for the (end > start) check in the return, since the
loop guarantees we won't go further back than the first char in the
line, and we do accept the first char to be the final backslash.

This fixes #2483.
2014-08-09 11:06:49 +02:00
Rob Rix
bbe13802b7 Demonstrate a trailing slash failure.
`git help ignore` has this to say about trailing slashes:

> If the pattern ends with a slash, it is removed for the purpose of
> the following description, but it would only find a match with a
> directory. In other words, foo/ will match a directory foo and
> paths underneath it, but will not match a regular file or a
> symbolic link foo (this is consistent with the way how pathspec
> works in general in Git).

Sure enough, having manually performed the same steps as this test,
`git status` tells us the following:

	# On branch master
	#
	# Initial commit
	#
	# Changes to be committed:
	#   (use "git rm --cached <file>..." to unstage)
	#
	#	new file:   force.txt
	#
	# Untracked files:
	#   (use "git add <file>..." to include in what will be committed)
	#
	#	../.gitignore
	#	child1/
	#	child2/

i.e. neither child1 nor child2 is ignored.
2014-08-08 15:19:16 -07:00
Carlos Martín Nieto
aa5cdf63bf status: failing test with slash-star
When writing 'bin/*' in the rules, this means we ignore very file inside
bin/ individually, but do not ignore the directory itself. Thus the
status listing should list both files under bin/, one untracked and one
ignored.
2014-08-08 14:53:22 -07:00
Russell Belfer
f18234fad6 Don't report status on named pipes
Git skips entries in directories that are not S_ISDIR, S_ISREG, or
S_ISLNK, so let's make libgit2 do the same thing.
2014-08-08 13:17:50 -07:00
Vicent Marti
8f759ac0b3 Merge pull request #2471 from jacquesg/compatibility-cleanup
Compatibility/Portability cleanup
2014-08-07 18:00:57 +02:00
Jacques Germishuys
c7dd0a56bf Use p_snprintf also in tests 2014-08-05 20:51:59 +02:00
Sven Strickroth
b8add6c42e Allow to propagate checkout callbacks to git HARD reset
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2014-08-03 16:29:51 +02:00
Carlos Martín Nieto
7db0e6ee48 merge: expose multiple merge bases
We always calculate multiple merge bases, but up to now we had only
exposed the "best" merge base.

Introduce git_oidarray which analogously to git_strarray lets us return
multiple ids.
2014-07-27 17:17:22 +02:00
Vicent Marti
243db06ce3 Merge pull request #2484 from libgit2/fix-git-status-list-new-unreadable-folder
Fix git status list new unreadable folder
2014-07-23 07:57:20 +02:00
Edward Thomson
0ba4dca526 git_cherry_pick -> git_cherrypick 2014-07-22 10:40:23 -04:00
Alan Rogers
7d0ab0fae0 Merge remote-tracking branch 'origin/master' into fix-git-status-list-new-unreadable-folder 2014-07-22 15:08:24 +10:00
Vicent Marti
ec813d83e7 Merge pull request #2476 from linquize/config-lf-eof
When adding new config section, handle config file not ending with LF
2014-07-16 13:07:17 -07:00
Vicent Marti
ed99e0b54f Merge pull request #2467 from ethomson/win_local_clone
Handle local file:/// paths on Windows
2014-07-16 13:00:15 -07:00
Linquize
693748694b Add unit test to test add section without lf at EOF 2014-07-16 21:54:53 +08:00
Edward Thomson
3d997dc255 Switch description and path reporting 2014-07-15 10:00:46 -04:00
Edward Thomson
529fd30d1f Handle local file:/// paths on Windows
Windows can't handle a path like `/c:/foo`; when turning file:///
URIs into local paths, we must strip the leading slash.
2014-07-11 18:46:00 -04:00
Vicent Marti
44cfb6f387 Merge pull request #2463 from libgit2/cmn/ssh-factory-for-paths
ssh: provide a factory function for setting ssh paths
2014-07-11 16:49:23 +02:00
Alan Rogers
4edd1a036b Merge remote-tracking branch 'origin/development' into fix-git-status-list-new-unreadable-folder 2014-07-10 19:17:34 -07:00
Carlos Martín Nieto
d4256ed554 ssh: provide a factory function for setting ssh paths
git allows you to set which paths to use for the git server programs
when connecting over ssh; and we want to provide something similar.

We do this by providing a factory function which can be set as the
remote's transport callback which will set the given paths upon
creation.
2014-07-07 14:51:51 +02:00
Carlos Martín Nieto
f5287fa6c3 refspec: support asterisks in the middle of a pattern
We used to assume a refspec would only have an asterisk in the middle of
their respective pattern. This has not been a valid assumption for some
time now with git.

Instead of assuming where the asterisk is going to be, change the logic
to treat each pattern as having two halves with a replacement bit in the
middle, where the asterisk is.
2014-07-04 18:00:20 +02:00
Vicent Marti
b0ed61f822 Merge pull request #2460 from libgit2/cmn/sched-yield
Move yield to the tests and enable for FreeBSD
2014-07-03 15:30:38 +02:00
Carlos Martín Nieto
905fb5929b Move yield to the tests and enable for FreeBSD
Move the definition of git_thread_yield() to the test which needs it and
add the correct definition for it for FreeBSD and derivatives.

Original patch adding FreeBSD and derivatives by @jacquesg.
2014-07-03 05:55:02 +02:00
Vicent Marti
193fe9cbbf Merge pull request #2459 from libgit2/cmn/http-url-path
netops: error out on url without a path
2014-07-03 02:41:10 +02:00
Carlos Martín Nieto
1380e7c6b1 netops: error out on url without a path
In order to connect to a remote server, we need to provide a path to the
repository we're interested in. Consider the lack of path in the url an
error.
2014-07-03 02:34:32 +02:00
Vicent Marti
c1bf2942fc Merge pull request #2455 from ethomson/equal_oid
Introduce `cl_assert_equal_oid`
2014-07-02 15:29:25 +02:00
Vicent Marti
4df4ebd7c7 Merge pull request #2453 from ethomson/checkout_index
git_checkout_index: checkout other indexes
2014-07-02 15:29:14 +02:00
Vicent Marti
b0ca1b18e2 Merge pull request #2452 from libgit2/cmn/clone-custom-repo
Provide a callback to customize the repository on clone
2014-07-02 15:29:05 +02:00
Carlos Martín Nieto
6812afaf38 clone: remote git_clone_into{,_local} from the public API
As git_clone now has callbacks to configure the details of the
repository and remote, remove the lower-level functions from the public
API, as they lack some of the logic from git_clone proper.
2014-07-02 07:05:00 +02:00
Edward Thomson
967f5a76b1 git_checkout_index: checkout other indexes
git_checkout_index can now check out other git_index's (that are not
necessarily the repository index).  This allows checkout_index to use
the repository's index for stat cache information instead of the index
data being checked out.  git_merge and friends now check out their
indexes directly instead of trying to blend it into the running index.
2014-07-01 17:32:15 -04:00
Edward Thomson
9879fee184 revwalk::simplify test should test
The revwalk::simplify test was not actually tested the values from
the revwalk against the expected.  (Further, the expected had two
IDs transposed.)
2014-07-01 14:40:16 -04:00
Edward Thomson
0cee70ebb7 Introduce cl_assert_equal_oid 2014-07-01 14:40:16 -04:00
Russell Belfer
5fa8cda981 Round up pool alloc sizes for alignment
To make sure that items returned from pool allocations are aligned
on nice boundaries, this rounds up all pool allocation sizes to a
multiple of 8.  This adds a small amount of overhead to each item.

The rounding up could be made optional with an extra parameter to
the pool initialization that turned on rounding only for pools
where item alignment actually matters, but I think for the extra
code and complexity that would be involved, that it makes sense
just to burn a little bit of extra memory and enable this all the
time.
2014-06-30 12:05:25 -07:00
Vicent Marti
dcdb8500e3 Merge pull request #2440 from phkelley/transports
Improvements to git_transport extensibility
2014-06-30 17:35:42 +02:00
Philip Kelley
1697cd6ff5 Improvements to git_transport extensibility
git_remote_set_transport now takes a transport factory rather than a transport
git_clone_options now allows the caller to specify a remote creation callback
2014-06-26 22:34:37 -04:00
Carlos Martín Nieto
e26b08d32c ssh: adjust clone and push test credentials to the split user+pass method
For urls where we do not specify a username, we must handle the case
where the ssh transport asks us for the username.

Test also that switching username fails.
2014-06-26 22:58:39 +02:00
Carlos Martín Nieto
ccb85c8fa1 ssh: make sure to ask for a username and use the same one
In order to know which authentication methods are supported/allowed by
the ssh server, we need to send a NONE auth request, which needs a
username associated with it.

Most ssh server implementations do not allow switching the username
between authentication attempts, which means we cannot use a dummy
username and then switch. There are two ways around this.

The first is to use a different connection, which an earlier commit
implements, but this increases how long it takes to get set up, and
without knowing the right username, we cannot guarantee that the
list we get in response is the right one.

The second is what's implemented here: if there is no username specified
in the url, ask for it first. We can then ask for the list of auth
methods and use the user's credentials in the same connection.
2014-06-26 22:58:39 +02:00
Carlos Martín Nieto
d7f962f408 ssh: request credentials again on authentication failure
Instead of completely giving up on the first failure, ask for
credentials as long as we fail to authenticate.
2014-06-26 22:58:38 +02:00
Edward Thomson
f4046267dc checkout::conflict tests: only test owner mode
The checkout::conflict type conflict tests were failing because
they were overly assertive about the resultant mode, testing
group & other bits, which failed miserably for people who had a
umask less restrictive than 022.  Only test the resultant owner bits.
2014-06-26 09:16:12 -04:00
Edward Thomson
d412165f94 Update text=auto / core.autocrlf=false behavior
Git for Windows 1.9.4 changed the behavior when the text=auto
attribute is specified and core.autocrlf=false.  Previous observed
behavior would *not* filter files when going into the working
directory, the new behavior *does* filter.  Update our behavior to match.
2014-06-24 13:46:32 -04:00
Carlos Martín Nieto
3ddd0d929d Merge remote-tracking branch 'upstream/cmn/mixed-eol-passthrough' 2014-06-24 17:55:15 +02:00
Carlos Martín Nieto
5e37874dd4 Merge remote-tracking branch 'upstream/cmn/treebuilder-perf' 2014-06-24 17:51:45 +02:00
Carlos Martín Nieto
5a76ad35aa crlf: pass-through mixed EOL buffers from LF->CRLF
When checking out files, we're performing conversion into the user's
native line endings, but we only want to do it for files which have
consistent line endings. Refuse to perform the conversion for mixed-EOL
files.

The CRLF->LF filter is left as-is, as that conversion is considered to be
normalization by git and should force a conversion of the line endings.
2014-06-23 22:27:12 +02:00
Carlos Martín Nieto
b3b66c5793 Share packs across repository instances
Opening the same repository multiple times will currently open the same
file multiple times, as well as map the same region of the file multiple
times. This is not necessary, as the packfile data is immutable.

Instead of opening and closing packfiles directly, introduce an
indirection and allocate packfiles globally. This does mean locking on
each packfile open, but we already use this lock for the global mwindow
list so it doesn't introduce a new contention point.
2014-06-23 21:50:36 +02:00
Carlos Martín Nieto
b529c5f96d ssh: propagate the error code from the auth callback
We need to be able to get a GIT_EUSER back through the outermost call.
2014-06-17 10:51:17 +02:00
Carlos Martín Nieto
22618906a5 ssh: detect authentication methods
Before calling the credentials callback, ask the sever which
authentication methods it supports and report that to the user, instead
of simply reporting everything that the transport supports.

In case of an error, we do fall back to listing all of them.
2014-06-17 10:51:17 +02:00
Carlos Martín Nieto
09561d33e4 test: remove assembla clone test
The assembla failure we were seeing referred to a private repository,
which is not what is there at the moment.

This reverts 1fd21b0342
2014-06-13 22:27:46 +02:00
Carlos Martín Nieto
3382d8b14f test: use read-only account
Don't write in plaintext the password of an account which has full
control over the repository. Instead use an account with read-only
access.
2014-06-13 22:24:43 +02:00
Carlos Martín Nieto
4d3f1f9740 treebuilder: use a map instead of vector to store the entries
Finding a filename in a vector means we need to resort it every time we
want to read from it, which includes every time we want to write to it
as well, as we want to find duplicate keys.

A hash-map fits what we want to do much more accurately, as we do not
care about sorting, but just the particular filename.

We still keep removed entries around, as the interface let you assume
they were going to be around until the treebuilder is cleared or freed,
but in this case that involves an append to a vector in the filter case,
which can now fail.

The only time we care about sorting is when we write out the tree, so
let's make that the only time we do any sorting.
2014-06-10 15:14:13 +02:00
Vicent Marti
ce5e6617b0 Merge pull request #2407 from libgit2/cmn/remote-rename-more
More remote rename fixes
2014-06-08 16:44:32 +02:00
Philip Kelley
fb5917679d Win32: Fix object::cache::threadmania test on x64 2014-06-07 12:51:48 -04:00
Philip Kelley
daf2a648b1 Win32: Fix diff::workdir::submodules test #2361 2014-06-07 12:18:56 -04:00
Philip Kelley
6d1b04383e Win32: Fix failing clone_mirror test 2014-06-07 12:18:24 -04:00
Carlos Martín Nieto
231f350d91 remote: don't free the remote on delete
This was a bad idea. Don't free except in the free function.
2014-06-06 22:55:34 +02:00
Carlos Martín Nieto
eb6aa791a7 remote: failing test for renaming with a symref 2014-06-06 22:36:41 +02:00
Carlos Martín Nieto
72bca13e5d remote: return problem refspecs instead of using a callback
There is no reason why we need to use a callback here. A string array
fits better with the usage, as this is not an event and we don't need
anything from the user.
2014-06-06 21:43:04 +02:00
Carlos Martín Nieto
fe3b9d0731 remote: failing test for rename
When there is a reference in the target namespace, we should overwrite
it. Instead it gets a different name under the current code.
2014-06-06 00:54:11 +02:00
Alan Rogers
dc49e1b5b3 Merge remote-tracking branch 'origin/development' into fix-git-status-list-new-unreadable-folder
Conflicts:
	include/git2/diff.h
2014-06-04 15:36:28 -07:00
Alan Rogers
a576a34257 Add another test for unreadable and not included. 2014-06-04 14:47:44 -07:00
Alan Rogers
79d5b5c916 Add GIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED
and a (failing) test for it.
2014-06-03 17:42:52 -07:00
Russell Belfer
dfcba09e67 Merge pull request #2395 from libgit2/cmn/ref-iter-concurrent
Concurrent ref iterator access
2014-06-03 13:05:20 -07:00
Vicent Marti
bccb36ebf9 Merge pull request #2389 from arthurschreiber/arthur/set-error-when-no-remote-found
Remote: Set an error when a remote cannot be found.
2014-06-03 17:25:59 +02:00
Carlos Martín Nieto
69a1a6918c Plug a leak in the tests 2014-06-03 16:18:08 +02:00
Carlos Martín Nieto
4ee2543c5a refs: failing test for concurrent ref access
If we remove a reference while we're iterating through the packed refs,
the position in the iterator will be off.
2014-06-02 16:46:47 +02:00
Alan Rogers
523553f902 Fix the no permissions test. 2014-05-30 16:22:26 -07:00
Alan Rogers
59fcebaa89 Use 'X' for unreadable status. 2014-05-30 16:22:13 -07:00
Arthur Schreiber
d723dbed0c Remote: Set an error when a remote cannot be found.
Inside `git_remote_load`, the calls to `get_optional_config` use
`giterr_clear` to unset any errors that are set due to missing config
keys. If neither a fetch nor a push url config was found for a remote,
we should set an error again.
2014-05-30 19:26:49 +02:00
Edward Thomson
49837fd49f Ignore core.safecrlf=warn until we have a warn infrastructure 2014-05-30 11:30:53 -05:00
Arthur Schreiber
9d6c3d2853 Refs: Extend unicode test for branch creation.
This adds another assertion to ensure that the reference name inside
the git_reference struct returned by `git_branch_create` is returned as
precomposed if `core.precomposeunicode` is enabled.
2014-05-30 15:15:54 +02:00
Arthur Schreiber
1a90b1e3f1 Refs: Add a unicode test for git_branch_move.
This tests that decomposed branch names are correctly precomposed when
passed to `git_branch_move` and `core.precomposeunicode` is enabled.
2014-05-30 14:53:28 +02:00
Vicent Marti
31c551528b Merge pull request #2011 from libgit2/cmn/clone-local
Local clone
2014-05-29 14:50:57 +02:00
Carlos Martín Nieto
bc9f67fa85 clone: more explicit local tests
Assert the exact amount of links we expect. While there, check that a
plain git_clone() automatically chooses to link.
2014-05-29 10:06:48 +02:00
Carlos Martín Nieto
2614819cf3 clone: allow for linking in local clone
If requested, git_clone_local_into() will try to link the object files
instead of copying them.

This only works on non-Windows (since it doesn't have this) when both
are on the same filesystem (which are unix semantics).
2014-05-28 15:40:47 +02:00
Carlos Martín Nieto
94f742bac6 fileops: allow linking files when copying directory structures
When passed the LINK_FILES flag, the recursive copy will hardlink files
instead of copying them.
2014-05-28 15:40:22 +02:00
Carlos Martín Nieto
c1dbfcbb4a clone: add flag not to link 2014-05-28 15:40:22 +02:00
Carlos Martín Nieto
121b26738e clone: add flags to override whether to perform a local clone 2014-05-28 15:40:22 +02:00
Vicent Marti
5d91bea22a Merge pull request #2380 from libgit2/cmn/index-add-modes
index: check for valid filemodes on add
2014-05-28 13:55:57 +02:00
Vicent Marti
ab882e21b4 Merge pull request #2385 from karipe/development
Fix compile error on Visual Studio
2014-05-28 13:49:38 +02:00
Edward Thomson
eff531e103 Modify GIT_MERGE_CONFIG -> GIT_MERGE_PREFERENCE 2014-05-27 20:58:20 -05:00