]> git.proxmox.com Git - libgit2.git/log
libgit2.git
9 years agoMerge pull request #2723 from ravindp/ravindp/fix_4_missing_delta_bases
Carlos Martín Nieto [Sat, 22 Nov 2014 17:39:50 +0000 (18:39 +0100)]
Merge pull request #2723 from ravindp/ravindp/fix_4_missing_delta_bases

Fix for misleading "missing delta bases" error.

9 years agoFix for misleading "missing delta bases" error - Fix #2721.
Ravindra Patel [Thu, 20 Nov 2014 17:07:55 +0000 (12:07 -0500)]
Fix for misleading "missing delta bases" error - Fix #2721.

9 years agoMerge pull request #2725 from libgit2/vmg/attr-null
Edward Thomson [Fri, 21 Nov 2014 18:16:42 +0000 (13:16 -0500)]
Merge pull request #2725 from libgit2/vmg/attr-null

Do not assume blob contents are NULL terminated

9 years agotext: Null-terminate a string if we've been gouging it
Vicent Marti [Fri, 21 Nov 2014 17:09:57 +0000 (18:09 +0100)]
text: Null-terminate a string if we've been gouging it

9 years agonotes: Use `git__strndup`
Vicent Marti [Fri, 21 Nov 2014 16:38:55 +0000 (17:38 +0100)]
notes: Use `git__strndup`

9 years agoblame: Do not assume blob contents are NULL-terminated
Vicent Marti [Fri, 21 Nov 2014 16:24:55 +0000 (17:24 +0100)]
blame: Do not assume blob contents are NULL-terminated

9 years agonotes: Do not assume blob contents are NULL-terminated
Vicent Marti [Fri, 21 Nov 2014 16:19:41 +0000 (17:19 +0100)]
notes: Do not assume blob contents are NULL-terminated

9 years agoattr_file: Do not assume ODB data is NULL-terminated
Vicent Marti [Fri, 21 Nov 2014 12:32:21 +0000 (13:32 +0100)]
attr_file: Do not assume ODB data is NULL-terminated

That's a bad assumption to make, even though right now it holds
(because of the way we've implemented decompression of packfiles),
this may change in the future, given that ODB objects can be
binary data.

Furthermore, the ODB object can return a NULL pointer if the object
is empty. Copying the NULL pointer to the strbuf lets us handle it
like an empty string. Again, the NULL pointer is valid behavior because
you're supposed to check the *size* of the object before working
on it.

9 years agobuffer: Do not `put` anything if len is 0
Vicent Marti [Fri, 21 Nov 2014 12:31:30 +0000 (13:31 +0100)]
buffer: Do not `put` anything if len is 0

9 years agoMerge pull request #2710 from Therzok/shellcheckScripts
Edward Thomson [Fri, 21 Nov 2014 15:59:20 +0000 (10:59 -0500)]
Merge pull request #2710 from Therzok/shellcheckScripts

Run shell scripts through shellcheck

9 years agoMerge pull request #2720 from ravindp/master
Carlos Martín Nieto [Fri, 21 Nov 2014 14:21:00 +0000 (15:21 +0100)]
Merge pull request #2720 from ravindp/master

Fix for memory leak issue in indexer.c, that surfaces on windows

9 years agoMerge pull request #2724 from libgit2/vmg/empty
Vicent Marti [Fri, 21 Nov 2014 13:18:32 +0000 (14:18 +0100)]
Merge pull request #2724 from libgit2/vmg/empty

odb: `git_odb_object` contents are never NULL

9 years agoodb: `git_odb_object` contents are never NULL
Vicent Marti [Fri, 21 Nov 2014 12:50:46 +0000 (13:50 +0100)]
odb: `git_odb_object` contents are never NULL

This is a contract that we made in the library and that we need to uphold. The
contents of a blob can never be NULL because several parts of the library (including
the filter and attributes code) expect `git_blob_rawcontent` to always return a
valid pointer.

9 years agoRun shell scripts through shellcheck
Ungureanu Marius [Mon, 17 Nov 2014 05:01:40 +0000 (07:01 +0200)]
Run shell scripts through shellcheck

9 years agoMerge pull request #2713 from libgit2/jamill/push_fetch_first
Vicent Marti [Thu, 20 Nov 2014 12:13:46 +0000 (13:13 +0100)]
Merge pull request #2713 from libgit2/jamill/push_fetch_first

Update message for error during push

9 years agoMerge pull request #2717 from libgit2/cmn/remote-ls
Vicent Marti [Thu, 20 Nov 2014 12:12:49 +0000 (13:12 +0100)]
Merge pull request #2717 from libgit2/cmn/remote-ls

Clarify the git_remote_ls() documentation

9 years agoMerge pull request #2719 from libgit2/cmn/fetch-twice
Vicent Marti [Thu, 20 Nov 2014 12:12:29 +0000 (13:12 +0100)]
Merge pull request #2719 from libgit2/cmn/fetch-twice

fetch: clear the connection data on close

9 years agoMerge pull request #2722 from libgit2/cmn/disable-ssh-check
Edward Thomson [Thu, 20 Nov 2014 00:12:59 +0000 (19:12 -0500)]
Merge pull request #2722 from libgit2/cmn/disable-ssh-check

travis: disable the cert callback on OSX

9 years agotravis: disable the cert callback on OSX
Carlos Martín Nieto [Wed, 19 Nov 2014 23:52:52 +0000 (00:52 +0100)]
travis: disable the cert callback on OSX

The sshd on OSX has stopped responding to the setting which this test
assumes is there, so let's disable it until we can figure out what's
happening.

9 years agofetch: clear the connection data on close
Carlos Martín Nieto [Wed, 19 Nov 2014 19:53:25 +0000 (20:53 +0100)]
fetch: clear the connection data on close

When we fetch twice with the same remote object, we did not properly
clear the connection flags, so we would leak state from the last
connection.

This can cause the second fetch with the same remote object to fail if
using a HTTP URL where the server redirects to HTTPS, as the second
fetch would see `use_ssl` set and think the initial connection wanted to
downgrade the connection.

9 years agoFix for memory leak issue in indexer.c, that surfaces on windows
Ravindra Patel [Wed, 19 Nov 2014 19:54:30 +0000 (14:54 -0500)]
Fix for memory leak issue in indexer.c, that surfaces on windows

9 years agoremote: don't say we free the remote on disconnect
Carlos Martín Nieto [Wed, 19 Nov 2014 14:49:47 +0000 (15:49 +0100)]
remote: don't say we free the remote on disconnect

On disconnect we simply ask the transport to close the connection, we do
not free it.

9 years agoremote: clarify which list of references _ls() returns
Carlos Martín Nieto [Wed, 19 Nov 2014 14:49:02 +0000 (15:49 +0100)]
remote: clarify which list of references _ls() returns

Make it clear that this is not the ls-remote command but a way to access
the data we have and how long it's kept around.

9 years agoRemove two completed projects from the list
Carlos Martín Nieto [Tue, 18 Nov 2014 17:32:25 +0000 (18:32 +0100)]
Remove two completed projects from the list

9 years agoMerge pull request #2654 from linquize/missing-obj
Edward Thomson [Tue, 18 Nov 2014 17:12:19 +0000 (12:12 -0500)]
Merge pull request #2654 from linquize/missing-obj

Fix missing object in tests/resources/crlf by changing the tail commit

9 years agoMerge pull request #2608 from libgit2/cmn/remote-push
Edward Thomson [Tue, 18 Nov 2014 16:44:59 +0000 (11:44 -0500)]
Merge pull request #2608 from libgit2/cmn/remote-push

Provide a convenience function `git_remote_push()`

9 years agoMerge pull request #2671 from swisspol/remote_create_fix
Edward Thomson [Tue, 18 Nov 2014 01:10:58 +0000 (20:10 -0500)]
Merge pull request #2671 from swisspol/remote_create_fix

Fixed active_refspecs field not initialized on new git_remote objects

9 years agoMerge pull request #2693 from libgit2/cmn/push-refspec-refactor
Edward Thomson [Mon, 17 Nov 2014 22:03:55 +0000 (17:03 -0500)]
Merge pull request #2693 from libgit2/cmn/push-refspec-refactor

push: use the common refspec parser

9 years agoMerge pull request #2699 from swisspol/fix_warnings
Edward Thomson [Mon, 17 Nov 2014 21:36:54 +0000 (16:36 -0500)]
Merge pull request #2699 from swisspol/fix_warnings

Fixed a couple Clang warnings

9 years agoUpdate message for error during push
Jameson Miller [Mon, 17 Nov 2014 21:30:31 +0000 (16:30 -0500)]
Update message for error during push

When attempting to update a reference on a remote during push, and the
reference on the remote refers to a commit that does not exist locally,
then we should report a more clear error message.

9 years agoFixed active_refspecs field not initialized on new git_remote objects
Pierre-Olivier Latour [Wed, 29 Oct 2014 03:56:18 +0000 (20:56 -0700)]
Fixed active_refspecs field not initialized on new git_remote objects

When creating a new remote, contrary to loading one from disk,
active_refspecs was not populated. This means that if using the new
remote to push, git_push_update_tips() will be a no-op since it
checks the refspecs passed during the push against the base ones
i.e. active_refspecs. And therefore the local refs won't be created
or updated after the push operation.

9 years agobranch: consider an empty upstream remote config as not found
Carlos Martín Nieto [Mon, 17 Nov 2014 13:28:22 +0000 (14:28 +0100)]
branch: consider an empty upstream remote config as not found

9 years agoMerge branch 'openssl-lock-free'
Carlos Martín Nieto [Mon, 17 Nov 2014 13:03:50 +0000 (14:03 +0100)]
Merge branch 'openssl-lock-free'

9 years agoPlug possible leak in the openssl locks
Ungureanu Marius [Sat, 15 Nov 2014 12:35:58 +0000 (14:35 +0200)]
Plug possible leak in the openssl locks

9 years agoMerge pull request #2707 from swisspol/fix_include
Carlos Martín Nieto [Sat, 15 Nov 2014 19:45:17 +0000 (20:45 +0100)]
Merge pull request #2707 from swisspol/fix_include

Fixed git2.h not including threads.h anymore

9 years agoMerge pull request #2708 from phatblat/pr/threading-doc
Carlos Martín Nieto [Sat, 15 Nov 2014 12:49:15 +0000 (13:49 +0100)]
Merge pull request #2708 from phatblat/pr/threading-doc

Fix typo in THREADING.md

9 years agoFix GCD typo
Ben Chatelain [Sat, 15 Nov 2014 04:15:42 +0000 (21:15 -0700)]
Fix GCD typo

9 years agoFixed git2.h not including threads.h anymore
Pierre-Olivier Latour [Fri, 14 Nov 2014 23:20:36 +0000 (08:20 +0900)]
Fixed git2.h not including threads.h anymore

9 years agoFixed a couple Clang warnings
Pierre-Olivier Latour [Sat, 8 Nov 2014 23:09:25 +0000 (08:09 +0900)]
Fixed a couple Clang warnings

9 years agopush: use the common refspec parser
Carlos Martín Nieto [Fri, 7 Nov 2014 14:00:11 +0000 (15:00 +0100)]
push: use the common refspec parser

There is one well-known and well-tested parser which we should use,
instead of implementing parsing a second time.

The common parser is also augmented to copy the LHS into the RHS if the
latter is empty.

The expressions test had to change a bit, as we now catch a bad RHS of a
refspec locally.

9 years agoMerge pull request #2653 from ethomson/contributing
Carlos Martín Nieto [Sun, 9 Nov 2014 12:41:57 +0000 (13:41 +0100)]
Merge pull request #2653 from ethomson/contributing

Add test information to contributing guidelines

9 years agoMerge pull request #2637 from libgit2/cmn/global-init
Edward Thomson [Sat, 8 Nov 2014 23:15:02 +0000 (18:15 -0500)]
Merge pull request #2637 from libgit2/cmn/global-init

Rename git_threads_ to git_libgit2_

9 years agoremote: use configured push refspecs if none are given
Carlos Martín Nieto [Sat, 11 Oct 2014 10:25:50 +0000 (12:25 +0200)]
remote: use configured push refspecs if none are given

If the user does not pass any refspecs to push, try to use those
configured via the configuration or via add_push().

9 years agopush: move main test function to git_remote_push()
Carlos Martín Nieto [Fri, 10 Oct 2014 11:35:57 +0000 (13:35 +0200)]
push: move main test function to git_remote_push()

We have the step-by-step method in the initialization function as we
want to remove references based on the list of references which are
already there, and we can use the convenience function for testing the
main push.

9 years agoremote: introduce git_remote_push()
Carlos Martín Nieto [Fri, 10 Oct 2014 10:39:53 +0000 (12:39 +0200)]
remote: introduce git_remote_push()

This function, similar in style to git_remote_fetch(), performs all the
steps required for a push, with a similar interface.

The remote callbacks struct has learnt about the push callbacks, letting
us set the callbacks a single time instead of setting some in the remote
and some in the push operation.

9 years agoRename git_threads_ to git_libgit2_
Carlos Martín Nieto [Thu, 23 Oct 2014 15:34:41 +0000 (17:34 +0200)]
Rename git_threads_ to git_libgit2_

This describes their purpose better, as we now initialize ssl and some
other global stuff in there. Calling the init function is not something
which has been optional for a while now.

9 years agoMerge pull request #2673 from swisspol/2672
Edward Thomson [Sat, 8 Nov 2014 22:45:38 +0000 (17:45 -0500)]
Merge pull request #2673 from swisspol/2672

Fixed GIT_REMOTE_DOWNLOAD_TAGS_ALL to behave like git 1.9.0+

9 years agoChanged GIT_REMOTE_DOWNLOAD_TAGS_ALL to behave like git 1.9.0
Pierre-Olivier Latour [Wed, 29 Oct 2014 05:18:38 +0000 (22:18 -0700)]
Changed GIT_REMOTE_DOWNLOAD_TAGS_ALL to behave like git 1.9.0

9 years agoMerge pull request #2698 from libgit2/cmn/fetchhead-refactor
Edward Thomson [Sat, 8 Nov 2014 22:05:13 +0000 (17:05 -0500)]
Merge pull request #2698 from libgit2/cmn/fetchhead-refactor

Refactor fetchhead

9 years agoMerge pull request #2695 from libgit2/cmn/remote-lookup
Edward Thomson [Sat, 8 Nov 2014 21:55:23 +0000 (16:55 -0500)]
Merge pull request #2695 from libgit2/cmn/remote-lookup

remote: rename _load() to _lookup()

9 years agoMerge pull request #2696 from libgit2/cmn/empty-objects
Edward Thomson [Sat, 8 Nov 2014 21:52:43 +0000 (16:52 -0500)]
Merge pull request #2696 from libgit2/cmn/empty-objects

odb: hardcode the empty blob and tree

9 years agoMerge pull request #2694 from Therzok/statusFile
Edward Thomson [Sat, 8 Nov 2014 21:49:30 +0000 (16:49 -0500)]
Merge pull request #2694 from Therzok/statusFile

git_status_file now takes an exact path.

9 years agoremote: refactor the reference-update decision
Carlos Martín Nieto [Sat, 8 Nov 2014 19:40:02 +0000 (20:40 +0100)]
remote: refactor the reference-update decision

This is an ugly chunk of code, so let's put it into its own function.

9 years agoodb: hardcode the empty blob and tree
Carlos Martín Nieto [Sat, 8 Nov 2014 13:40:53 +0000 (14:40 +0100)]
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.

9 years agoremote: don't check for upstream on an anonymous remote
Carlos Martín Nieto [Sat, 8 Nov 2014 19:21:14 +0000 (20:21 +0100)]
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.

9 years agoremote: use git_branch_upstream_remote()
Carlos Martín Nieto [Sat, 8 Nov 2014 19:09:11 +0000 (20:09 +0100)]
remote: use git_branch_upstream_remote()

This reduces the clutter somewhat and lets us see what we're asking
about the reference.

9 years agobranch: add getter for the upstream remote name
Carlos Martín Nieto [Sat, 8 Nov 2014 19:00:17 +0000 (20:00 +0100)]
branch: add getter for the upstream remote name

This gets the value from branch.<foo>.remote.

9 years agoremote: rename _load() to _lookup()
Carlos Martín Nieto [Sat, 8 Nov 2014 12:25:51 +0000 (13:25 +0100)]
remote: rename _load() to _lookup()

This brings it in line with the rest of the lookup functions.

9 years agogit_status_file now takes an exact path
Ungureanu Marius [Fri, 7 Nov 2014 18:32:50 +0000 (20:32 +0200)]
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.

9 years agoMerge pull request #2691 from libgit2/cmn/submodule-and-dir
Edward Thomson [Fri, 7 Nov 2014 14:28:41 +0000 (09:28 -0500)]
Merge pull request #2691 from libgit2/cmn/submodule-and-dir

submodules: stale module entries

9 years agoiterator: submodules are determined by an index or tree
Carlos Martín Nieto [Thu, 6 Nov 2014 15:16:46 +0000 (16:16 +0100)]
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.

9 years agosubmodules: add failing test for stale module entries
Carlos Martín Nieto [Thu, 6 Nov 2014 10:47:50 +0000 (11:47 +0100)]
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.

9 years agoMerge pull request #2692 from ethomson/bug2515
Carlos Martín Nieto [Fri, 7 Nov 2014 07:32:50 +0000 (08:32 +0100)]
Merge pull request #2692 from ethomson/bug2515

checkout_index: handle other stages

9 years agocheckout_index: Remove stage 0 when checking out conflicts
Edward Thomson [Thu, 6 Nov 2014 23:49:37 +0000 (18:49 -0500)]
checkout_index: Remove stage 0 when checking out conflicts

9 years agocheckout_index: remove conflicts when checking out new files
Edward Thomson [Thu, 6 Nov 2014 19:40:21 +0000 (14:40 -0500)]
checkout_index: remove conflicts when checking out new files

9 years agoMerge pull request #2598 from libgit2/cmn/stacked-ignore
Edward Thomson [Thu, 6 Nov 2014 15:38:25 +0000 (10:38 -0500)]
Merge pull request #2598 from libgit2/cmn/stacked-ignore

ignore: don't leak rules into higher directores

9 years agoMerge pull request #2676 from libgit2/cmn/threading
Edward Thomson [Thu, 6 Nov 2014 15:25:23 +0000 (10:25 -0500)]
Merge pull request #2676 from libgit2/cmn/threading

Threading and crypto libraries

9 years agoMerge pull request #2682 from libgit2/cmn/fetch-tags-refspec
Edward Thomson [Thu, 6 Nov 2014 15:19:22 +0000 (10:19 -0500)]
Merge pull request #2682 from libgit2/cmn/fetch-tags-refspec

remote: check for the validity of the refspec when updating FETCH_HEAD

9 years agoignore: don't leak rules into higher directories
Carlos Martín Nieto [Wed, 5 Nov 2014 15:51:39 +0000 (16:51 +0100)]
ignore: don't leak rules into higher directories

A rule "src" in src/.gitignore must only match subdirectories of
src/. The current code does not include this context in the match rule
and would thus consider this rule to match the top-level src/ directory
instead of the intended src/src/.

Keep track fo the context in which the rule was defined so we can
perform a prefix match.

9 years agoignore: add failing test for a file mentioning the parent
Carlos Martín Nieto [Sat, 4 Oct 2014 09:48:50 +0000 (11:48 +0200)]
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.

9 years agoMerge pull request #2688 from libgit2/cmn/ignore-file-trailing-cr
Edward Thomson [Wed, 5 Nov 2014 15:47:19 +0000 (10:47 -0500)]
Merge pull request #2688 from libgit2/cmn/ignore-file-trailing-cr

ignore: consider files with a CR in their names

9 years agoignore: consider files with a CR in their names
Carlos Martín Nieto [Wed, 5 Nov 2014 15:07:07 +0000 (16:07 +0100)]
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.

9 years agoMerge pull request #2686 from ethomson/rename_notfound
Carlos Martín Nieto [Mon, 3 Nov 2014 21:27:11 +0000 (22:27 +0100)]
Merge pull request #2686 from ethomson/rename_notfound

Propogate GIT_ENOTFOUND from git_remote_rename

9 years agogit_remote_rename: propogate GIT_ENOTFOUND
Edward Thomson [Mon, 3 Nov 2014 19:07:20 +0000 (14:07 -0500)]
git_remote_rename: propogate GIT_ENOTFOUND

9 years agoMerge pull request #2679 from jfultz/missing-include
Edward Thomson [Mon, 3 Nov 2014 16:32:47 +0000 (11:32 -0500)]
Merge pull request #2679 from jfultz/missing-include

Make config reading continue after hitting a missing include file.

9 years agoremote: check the relevance of the refspec when updating FETCH_HEAD
Carlos Martín Nieto [Sun, 2 Nov 2014 19:11:54 +0000 (20:11 +0100)]
remote: check the relevance of the refspec when updating FETCH_HEAD

Before trying to rtransform using the given refspec to figure out what
the name of the upstream branch is on the remote, we must make sure that
the target of the refspec applies to the current branch's upstream.

9 years agoMerge pull request #2661 from swisspol/2656
Edward Thomson [Mon, 3 Nov 2014 14:10:14 +0000 (15:10 +0100)]
Merge pull request #2661 from swisspol/2656

Changed context_lines and interhunk_lines to uint32_t to match struct s_xdemitconf

9 years agoMerge pull request #2683 from libgit2/cmn/remote-unify
Edward Thomson [Mon, 3 Nov 2014 14:01:41 +0000 (15:01 +0100)]
Merge pull request #2683 from libgit2/cmn/remote-unify

remote: unify the creation code

9 years agoMerge pull request #2680 from libgit2/cmn/invalid-cert-return
Edward Thomson [Mon, 3 Nov 2014 13:57:39 +0000 (14:57 +0100)]
Merge pull request #2680 from libgit2/cmn/invalid-cert-return

netops: return GIT_ECERTIFICATE when it fails the basic tests

9 years agoMerge pull request #2685 from libgit2/cmn/mmap-readable
Edward Thomson [Mon, 3 Nov 2014 13:52:34 +0000 (14:52 +0100)]
Merge pull request #2685 from libgit2/cmn/mmap-readable

Fix segmentation fault observed on OpenBSD/sparc64

9 years agoMerge pull request #2684 from jacquesg/openssl-windows
Edward Thomson [Mon, 3 Nov 2014 13:49:56 +0000 (14:49 +0100)]
Merge pull request #2684 from jacquesg/openssl-windows

Make the Visual Studio compiler happy

9 years agoFix segmentation fault observed on OpenBSD/sparc64
Stefan Sperling [Mon, 3 Nov 2014 12:46:56 +0000 (13:46 +0100)]
Fix segmentation fault observed on OpenBSD/sparc64

A non-readable mapping of a file causes an access violation in
the pack tests. Always use PROT_READ to work around this.

9 years agoMake the Visual Studio compiler happy
Jacques Germishuys [Mon, 3 Nov 2014 12:23:13 +0000 (14:23 +0200)]
Make the Visual Studio compiler happy

9 years agoClean up issues include.path issues found during code review.
John Fultz [Mon, 3 Nov 2014 01:16:49 +0000 (19:16 -0600)]
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.

9 years agoremote: unify the creation code
Carlos Martín Nieto [Sun, 2 Nov 2014 20:57:14 +0000 (21:57 +0100)]
remote: unify the creation code

The create function with default refspec is the same as the one with a
custom refspec, but it has the default refspec, so we can create the one
on top of the other.

9 years agoremote: fix tagopt test
Carlos Martín Nieto [Sun, 2 Nov 2014 19:39:29 +0000 (20:39 +0100)]
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.

9 years agoremote: add a failing test for checking the current branch's upstream
Carlos Martín Nieto [Sun, 2 Nov 2014 19:03:23 +0000 (20:03 +0100)]
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.

9 years agomerge: talk about the merging state after git_merge()
Carlos Martín Nieto [Sun, 2 Nov 2014 16:18:19 +0000 (17:18 +0100)]
merge: talk about the merging state after git_merge()

Since it's not necessarily obvious, mention the merging state and how to
clear it.

9 years agonetops: return GIT_ECERTIFICATE when it fails the basic tests
Carlos Martín Nieto [Sun, 2 Nov 2014 15:12:10 +0000 (16:12 +0100)]
netops: return GIT_ECERTIFICATE when it fails the basic tests

When we first ask OpenSSL to verify the certfiicate itself (rather
than the HTTPS specifics), we should also return
GIT_ECERTIFICATE. Otherwise, the caller would consider this as a failed
operation rather than a failed validation and not call the user's own
validation.

9 years agoMake config reading continue after hitting a missing include file.
John Fultz [Sat, 1 Nov 2014 16:21:45 +0000 (11:21 -0500)]
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.

9 years agodocs: explicitly document the threading caveats
Carlos Martín Nieto [Fri, 31 Oct 2014 10:24:02 +0000 (11:24 +0100)]
docs: explicitly document the threading caveats

Talk about sharing objects and error messages; but the most important
part is about what to do with the cryptographic libraries, which sadly
have to become to responsibility of the application.

9 years agossl: separate locking init from general init
Carlos Martín Nieto [Sat, 1 Nov 2014 09:45:33 +0000 (10:45 +0100)]
ssl: separate locking init from general init

Extract the lock-setting functions into their own, as we cannot assume
that it's ok for us to set this unconditionally.

9 years agossl: clear the OpenSSL locking function
Carlos Martín Nieto [Sat, 1 Nov 2014 09:26:09 +0000 (10:26 +0100)]
ssl: clear the OpenSSL locking function

We're freeing the memory which holds the locks so we must make sure that
the locking function doesn't try to use it.

9 years agoMerge pull request #2669 from ethomson/revert_test_fix
Edward Thomson [Mon, 27 Oct 2014 22:04:21 +0000 (15:04 -0700)]
Merge pull request #2669 from ethomson/revert_test_fix

revert tests: always use core.autocrlf=false in tests

9 years agorevert tests: always use core.autocrlf=false in tests
Edward Thomson [Mon, 27 Oct 2014 21:27:25 +0000 (17:27 -0400)]
revert tests: always use core.autocrlf=false in tests

9 years agoMerge pull request #2659 from swisspol/static_analysis
Edward Thomson [Mon, 27 Oct 2014 19:19:42 +0000 (12:19 -0700)]
Merge pull request #2659 from swisspol/static_analysis

Fixed the most obvious Clang static analyzer warnings

9 years agoFixed potential crash with uninitialized variables
Pierre-Olivier Latour [Sun, 26 Oct 2014 17:30:05 +0000 (10:30 -0700)]
Fixed potential crash with uninitialized variables

9 years agoRemoved some useless variable assignments
Pierre-Olivier Latour [Sun, 26 Oct 2014 17:29:19 +0000 (10:29 -0700)]
Removed some useless variable assignments

9 years agoChanged context_lines and interhunk_lines to uint32_t to match struct s_xdemitconf
Pierre-Olivier Latour [Sun, 26 Oct 2014 17:40:46 +0000 (10:40 -0700)]
Changed context_lines and interhunk_lines to uint32_t to match struct s_xdemitconf

9 years agoMerge pull request #2666 from libgit2/cmn/threadsafe-on
Edward Thomson [Mon, 27 Oct 2014 13:33:11 +0000 (06:33 -0700)]
Merge pull request #2666 from libgit2/cmn/threadsafe-on

Flip THREADSAFE's default to ON