]> git.proxmox.com Git - libgit2.git/log
libgit2.git
7 years agoworktree: implement `git_repository_open_from_worktree`
Patrick Steinhardt [Wed, 21 Oct 2015 10:10:30 +0000 (12:10 +0200)]
worktree: implement `git_repository_open_from_worktree`

Add function `git_repository_open_from_worktree`, which allows to open a
`git_worktree` as repository.

7 years agoworktree: introduce `struct git_worktree`
Patrick Steinhardt [Wed, 21 Oct 2015 10:02:31 +0000 (12:02 +0200)]
worktree: introduce `struct git_worktree`

Introduce a new `struct git_worktree`, which holds information
about a possible working tree connected to a repository.
Introduce functions to allow opening working trees for a
repository.

7 years agoworktree: implement `git_worktree_list`
Patrick Steinhardt [Wed, 21 Oct 2015 09:48:02 +0000 (11:48 +0200)]
worktree: implement `git_worktree_list`

Add new module for working trees with the `git_worktree_list`
function. The function lists names for all working trees of a
certain repository.

7 years agorepository: expose `repo_init_create_head`
Patrick Steinhardt [Mon, 26 Oct 2015 15:21:09 +0000 (16:21 +0100)]
repository: expose `repo_init_create_head`

Expose the function `repo_init_create_head` as
`git_repository_create_head`.

7 years agoconfig: open configuration in commondir
Patrick Steinhardt [Thu, 24 Sep 2015 12:37:10 +0000 (14:37 +0200)]
config: open configuration in commondir

A repository's configuartion file can always be found in the
GIT_COMMON_DIR, which has been newly introduced. For normal
repositories this does change nothing, but for working trees this
change allows to access the shared configuration file.

7 years agorefdb: look for reflog in commondir
Patrick Steinhardt [Thu, 24 Sep 2015 13:32:26 +0000 (15:32 +0200)]
refdb: look for reflog in commondir

7 years agorefdb: introduce commondir awareness
Patrick Steinhardt [Wed, 16 Sep 2015 14:09:24 +0000 (16:09 +0200)]
refdb: introduce commondir awareness

The refdb_fs_backend is not aware of the git commondir, which
stores common objects like the o bject database and packed/loose
refereensces when worktrees are used.

Make refdb_fs_backend aware of the common directory by
introducing a new commonpath variable that points to the actual
common path of the database and using it instead of the gitdir
for the mentioned objects.

7 years agorefdb: rename refdb_fs_backend's .path to .gitpath
Patrick Steinhardt [Thu, 17 Sep 2015 09:40:55 +0000 (11:40 +0200)]
refdb: rename refdb_fs_backend's .path to .gitpath

The variable '.path' of the refdb_fs_backend struct becomes
confusing regarding the introduction of the git commondir. It
does not immediatly become obvious what it should point to.

Fix this problem by renaming the variable to `gitpath`,
clarifying that it acutally points to the `.git` directory of the
repository, in contrast to the commonpath directory, which points
to the directory containing shared objects like references and
the object store.

7 years agorepository: introduce is_worktree variable
Patrick Steinhardt [Thu, 15 Oct 2015 13:58:05 +0000 (15:58 +0200)]
repository: introduce is_worktree variable

7 years agorepository: use `git_repository_item_path`
Patrick Steinhardt [Fri, 11 Nov 2016 13:36:43 +0000 (14:36 +0100)]
repository: use `git_repository_item_path`

The recent introduction of the commondir variable of a repository
requires callers to distinguish whether their files are part of
the dot-git directory or the common directory shared between
multpile worktrees. In order to take the burden from callers and
unify knowledge on which files reside where, the
`git_repository_item_path` function has been introduced which
encapsulate this knowledge.

Modify most existing callers of `git_repository_path` to use
`git_repository_item_path` instead, thus making them implicitly
aware of the common directory.

7 years agorepository: add function to retrieve paths for repo items
Patrick Steinhardt [Fri, 11 Nov 2016 12:46:59 +0000 (13:46 +0100)]
repository: add function to retrieve paths for repo items

7 years agorepository: introduce commondir variable
Patrick Steinhardt [Wed, 16 Sep 2015 10:10:11 +0000 (12:10 +0200)]
repository: introduce commondir variable

The commondir variable stores the path to the common directory.
The common directory is used to store objects and references
shared across multiple repositories. A current use case is the
newly introduced `git worktree` feature, which sets up a separate
working copy, where the backing git object store and references
are pointed to by the common directory.

7 years agotests: implement worktree helpers
Patrick Steinhardt [Wed, 11 Nov 2015 09:54:41 +0000 (10:54 +0100)]
tests: implement worktree helpers

7 years agotests: add merge-conflict branch for testrepo
Patrick Steinhardt [Tue, 10 Nov 2015 14:53:09 +0000 (15:53 +0100)]
tests: add merge-conflict branch for testrepo

Add a new branch that causes a merge conflict to `testrepo` so
that we are able to test merging in worktrees.

7 years agotests: add submodule worktree test data
Patrick Steinhardt [Mon, 9 Nov 2015 16:00:41 +0000 (17:00 +0100)]
tests: add submodule worktree test data

Create worktrees for submodule repositories. The worktrees are
created for the parent repository (e.g. the one containing
submodules) and for the contained child repository.

7 years agotests: add worktree test data
Patrick Steinhardt [Wed, 11 Nov 2015 09:54:08 +0000 (10:54 +0100)]
tests: add worktree test data

7 years agoMerge pull request #4112 from cbargren/fix/proxy-env-vars
Edward Thomson [Fri, 10 Feb 2017 16:15:41 +0000 (16:15 +0000)]
Merge pull request #4112 from cbargren/fix/proxy-env-vars

Add support for lowercase proxy environment variables

7 years agoFixing a code style issue
Christopher Bargren [Fri, 10 Feb 2017 14:59:22 +0000 (07:59 -0700)]
Fixing a code style issue

7 years agoMerge pull request #4111 from pks-t/pks/dos-prefix
Edward Thomson [Fri, 10 Feb 2017 11:01:23 +0000 (11:01 +0000)]
Merge pull request #4111 from pks-t/pks/dos-prefix

dirname with DOS prefixes

7 years agoMerge pull request #4117 from rcjsuen/patch-1
Edward Thomson [Fri, 10 Feb 2017 10:59:27 +0000 (10:59 +0000)]
Merge pull request #4117 from rcjsuen/patch-1

Flag options in git_stash_apply and git_stash_pop as being optional

7 years agoMerge pull request #4119 from libgit2/ethomson/submodule_renames
Edward Thomson [Fri, 10 Feb 2017 08:57:37 +0000 (08:57 +0000)]
Merge pull request #4119 from libgit2/ethomson/submodule_renames

rename detection: don't try to detect submodule renames

7 years agodiff: don't do rename detection on submodules
Edward Thomson [Thu, 9 Feb 2017 18:28:19 +0000 (18:28 +0000)]
diff: don't do rename detection on submodules

7 years agomerge: don't do rename detection on submodules
Edward Thomson [Thu, 9 Feb 2017 16:57:22 +0000 (16:57 +0000)]
merge: don't do rename detection on submodules

7 years agomerge_trees: introduce test for submodule renames
Edward Thomson [Thu, 9 Feb 2017 16:52:03 +0000 (16:52 +0000)]
merge_trees: introduce test for submodule renames

Test that shows that submodules are incorrectly considered in renames,
and `git_merge_trees` will fail to lookup the submodule as a blob.

7 years agoFlag optional parameters for apply and pop
Remy Suen [Thu, 9 Feb 2017 10:12:31 +0000 (19:12 +0900)]
Flag optional parameters for apply and pop

The options parameter in both git_stash_apply and git_stash_pop can
be NULL. They should be flagged as such in the documentation.

7 years agoMerge pull request #4104 from cbargren/fix/windows-digest-proxy
Edward Thomson [Thu, 9 Feb 2017 09:27:04 +0000 (09:27 +0000)]
Merge pull request #4104 from cbargren/fix/windows-digest-proxy

Fix digest credentials for proxy in windows

7 years agoAddressing PR feedback
Christopher Bargren [Wed, 8 Feb 2017 22:01:30 +0000 (15:01 -0700)]
Addressing PR feedback

7 years agoAdd support for lowercase proxy environment variables
Christopher Bargren [Tue, 7 Feb 2017 23:33:28 +0000 (16:33 -0700)]
Add support for lowercase proxy environment variables

curl supports HTTPS_PROXY in addition to https_proxy (and their http counterparts). This change ensures parity with curl's behavior.

7 years agotests: repo: assert discovery starting at Win32 roots finishes
Patrick Steinhardt [Wed, 8 Feb 2017 11:02:32 +0000 (12:02 +0100)]
tests: repo: assert discovery starting at Win32 roots finishes

As of recently, we failed to correctly discover repositories at a
Win32 system root. Instead of aborting the upwards-traversal of
the file system, we were looping infinitely when traversal
started at either a Win32 drive prefix ("C:/") or a network path
("//somehost").

The issue has been fixed, so add a test to catch regressions.

7 years agopath: ensure dirname on Win32 prefix always has a trailing '/'
Patrick Steinhardt [Wed, 8 Feb 2017 10:41:10 +0000 (11:41 +0100)]
path: ensure dirname on Win32 prefix always has a trailing '/'

When calling `git_path_dirname_r` on a Win32 prefix, e.g. a drive
or network share prefix, we always want to return the trailing
'/'. This does not work currently when passing in a path like
'C:', where the '/' would not be appended correctly.

Fix this by appending a '/' if we try to normalize a Win32 prefix
and there is no trailing '/'.

7 years agopath: get correct dirname for Windows root
Patrick Steinhardt [Tue, 7 Feb 2017 19:30:11 +0000 (20:30 +0100)]
path: get correct dirname for Windows root

Getting the dirname of a filesystem root should return the filesystem
root itself. E.g. the dirname of "/" is always "/". On Windows, we
emulate this behavior and as such, we should return e.g. "C:/" if
calling dirname on "C:/". But we currently fail to do so and instead
return ".", as we do not check if we actually have a Windows prefix
before stripping off the last directory component.

Fix this by calling out to `win32_prefix_length` immediately after
stripping trailing slashes, returning early if we have a prefix.

7 years agopath: extract `win32_path_prefix` function
Patrick Steinhardt [Tue, 7 Feb 2017 19:21:38 +0000 (20:21 +0100)]
path: extract `win32_path_prefix` function

Extract code which determines if a path is at a Windows system's root.
This incluses drive prefixes (e.g. "C:\") as well as network computer
names (e.g. "//computername/").

7 years agoMerge pull request #4109 from rcjsuen/patch-1
Edward Thomson [Wed, 8 Feb 2017 10:21:55 +0000 (10:21 +0000)]
Merge pull request #4109 from rcjsuen/patch-1

Flag checkout_opts in git_reset as optional

7 years agoPass proxy options payload to credentials callback
Christopher Bargren [Mon, 6 Feb 2017 18:00:06 +0000 (11:00 -0700)]
Pass proxy options payload to credentials callback

7 years agoFix digest credentials for proxy in windows
Chris Bargren [Wed, 1 Feb 2017 16:28:30 +0000 (09:28 -0700)]
Fix digest credentials for proxy in windows

7 years agoFlag checkout_opts in git_reset as optional
Remy Suen [Sat, 4 Feb 2017 22:12:32 +0000 (07:12 +0900)]
Flag checkout_opts in git_reset as optional

The check_outs argument can be NULL and should be flagged accordingly
in the header file.

7 years agoMerge pull request #4108 from rcjsuen/patch-1
Edward Thomson [Sat, 4 Feb 2017 10:04:30 +0000 (11:04 +0100)]
Merge pull request #4108 from rcjsuen/patch-1

Flag given_opts in git_revert as optional

7 years agoFlag given_opts in git_revert as optional
Remy Suen [Sat, 4 Feb 2017 08:24:31 +0000 (17:24 +0900)]
Flag given_opts in git_revert as optional

The given_opts argument can actually be NULL and thus should be
flagged accordingly in the header file.

7 years agoMerge pull request #4105 from pks-t/pks/vector-reverse-overflow
Edward Thomson [Thu, 2 Feb 2017 16:21:23 +0000 (17:21 +0100)]
Merge pull request #4105 from pks-t/pks/vector-reverse-overflow

Vector reverse overflow

7 years agovector: do not reverse a vector if it is empty
Patrick Steinhardt [Thu, 2 Feb 2017 15:02:57 +0000 (16:02 +0100)]
vector: do not reverse a vector if it is empty

The code reversing a vector initially determines the rear-pointer by
simply subtracting 1 from the vector's length. Obviously, this fails if
the vector is empty, in which case we have an integer overflow.

Fix the issue by returning early if the vector is empty.

7 years agorevwal: add failing test for walking with topo-sort
Adam Niedzielski [Wed, 1 Feb 2017 16:31:31 +0000 (17:31 +0100)]
revwal: add failing test for walking with topo-sort

7 years agoMerge pull request #4096 from mplough/master
Edward Thomson [Thu, 2 Feb 2017 13:31:33 +0000 (13:31 +0000)]
Merge pull request #4096 from mplough/master

Update docs for git_oid_fromstrn and p

7 years agoUpdate docs for git_oid_fromstrn and p
Matthew Plough [Fri, 27 Jan 2017 19:37:16 +0000 (14:37 -0500)]
Update docs for git_oid_fromstrn and p

7 years agoMerge pull request #4095 from mplough/master
Edward Thomson [Fri, 27 Jan 2017 17:56:52 +0000 (17:56 +0000)]
Merge pull request #4095 from mplough/master

Fix uninitialized variable warning

7 years agoFix uninitialized variable warning
Matthew Plough [Fri, 27 Jan 2017 17:49:48 +0000 (12:49 -0500)]
Fix uninitialized variable warning

Fix the following warning emitted by clang:
[ 16%] Building C object CMakeFiles/libgit2_clar.dir/src/submodule.c.o
/Users/mplough/devel/external/libgit2/src/submodule.c:408:6: warning: variable 'i' is used uninitialized whenever 'if' condition is true
      [-Wsometimes-uninitialized]
        if ((error = load_submodule_names(names, cfg)))
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/mplough/devel/external/libgit2/src/submodule.c:448:20: note: uninitialized use occurs here
        git_iterator_free(i);
                          ^
/Users/mplough/devel/external/libgit2/src/submodule.c:408:2: note: remove the 'if' if its condition is always false
        if ((error = load_submodule_names(names, cfg)))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/mplough/devel/external/libgit2/src/submodule.c:404:17: note: initialize the variable 'i' to silence this warning
        git_iterator *i;
                       ^
                        = NULL
1 warning generated.

7 years agoMerge pull request #4086 from libgit2/ethomson/fixes
Carlos Martín Nieto [Tue, 24 Jan 2017 21:26:41 +0000 (21:26 +0000)]
Merge pull request #4086 from libgit2/ethomson/fixes

WIP: some coverity & compiler warning fixes

7 years agoMerge pull request #4050 from ethomson/ethomson/winhttp_errmsgs
Carlos Martín Nieto [Tue, 24 Jan 2017 21:10:46 +0000 (21:10 +0000)]
Merge pull request #4050 from ethomson/ethomson/winhttp_errmsgs

WinHTTP: set proper error messages when SSL fails

7 years agocheckout::tree test: cleanup memory leak
Edward Thomson [Mon, 23 Jan 2017 23:32:13 +0000 (17:32 -0600)]
checkout::tree test: cleanup memory leak

7 years agoattr_cache_remove: don't remove given file
Edward Thomson [Mon, 23 Jan 2017 23:00:00 +0000 (23:00 +0000)]
attr_cache_remove: don't remove given file

If `attr_cache_lookup_entry` fails to find the given file, make sure
that we do not try to free the given file.

7 years agomac: on 32 bit, use `__builtin_umull_overflow`
Edward Thomson [Sun, 22 Jan 2017 01:42:45 +0000 (01:42 +0000)]
mac: on 32 bit, use `__builtin_umull_overflow`

7 years agosubmodule: only examine idx & head given a config
Edward Thomson [Sun, 22 Jan 2017 00:58:41 +0000 (00:58 +0000)]
submodule: only examine idx & head given a config

7 years agosubmodule: don't double free during load failure
Edward Thomson [Sun, 22 Jan 2017 00:30:02 +0000 (00:30 +0000)]
submodule: don't double free during load failure

When we fail to load submodules, don't free the list; it is later freed
unconditionally.

7 years agoMerge pull request #4087 from tiennou/warnings
Edward Thomson [Mon, 23 Jan 2017 13:29:14 +0000 (13:29 +0000)]
Merge pull request #4087 from tiennou/warnings

Fix a few recent warnings

7 years agovariable 'i' is used uninitialized whenever 'if' condition is true
Etienne Samson [Mon, 23 Jan 2017 12:29:47 +0000 (13:29 +0100)]
variable 'i' is used uninitialized whenever 'if' condition is true

7 years agoparameter 'id' not found in the function declaration
Etienne Samson [Mon, 23 Jan 2017 12:28:02 +0000 (12:28 +0000)]
parameter 'id' not found in the function declaration

7 years agoMerge pull request #4051 from tiennou/clang-analyzer-1
Edward Thomson [Sat, 21 Jan 2017 23:58:41 +0000 (23:58 +0000)]
Merge pull request #4051 from tiennou/clang-analyzer-1

Clang analyzer run

7 years agoMerge pull request #4053 from chescock/extend-packfile-by-pages
Edward Thomson [Sat, 21 Jan 2017 23:55:21 +0000 (23:55 +0000)]
Merge pull request #4053 from chescock/extend-packfile-by-pages

Extend packfile in increments of page_size.

7 years agoMerge branch 'pr/3912'
Edward Thomson [Sat, 21 Jan 2017 23:50:38 +0000 (23:50 +0000)]
Merge branch 'pr/3912'

7 years agosymbolic ref target validation: fixups
Edward Thomson [Sat, 21 Jan 2017 23:45:23 +0000 (23:45 +0000)]
symbolic ref target validation: fixups

Fixups requested in #3912.

7 years agowinhttp: set proper cert failure error messages
Edward Thomson [Fri, 30 Dec 2016 17:42:42 +0000 (12:42 -0500)]
winhttp: set proper cert failure error messages

Set up a WinHTTP status callback; inspect the WinHTTP status for
WINHTTP_CALLBACK_STATUS_SECURE_FAILURE, and convert the status code
to a useful message for callers.

7 years agoMerge pull request #4078 from pks-t/pks/example-cleanup
Edward Thomson [Sat, 21 Jan 2017 23:11:13 +0000 (23:11 +0000)]
Merge pull request #4078 from pks-t/pks/example-cleanup

Fix general example memory leaks

7 years agoMerge pull request #3892 from mitesch/shared_buffer
Edward Thomson [Sat, 21 Jan 2017 22:51:50 +0000 (22:51 +0000)]
Merge pull request #3892 from mitesch/shared_buffer

Use a shared buffer in calls of git_treebuilder_write to avoid heap contention

7 years agoCHANGELOG: move `git_submodule_update_option` changes
Edward Thomson [Sat, 21 Jan 2017 22:40:37 +0000 (22:40 +0000)]
CHANGELOG: move `git_submodule_update_option` changes

The changes to `git_submodule_update_option` are now landing in v.Next.

7 years agoMerge branch 'master' into pr/3938
Edward Thomson [Sat, 21 Jan 2017 22:39:59 +0000 (22:39 +0000)]
Merge branch 'master' into pr/3938

7 years agoMerge pull request #4085 from libgit2/ethomson/packfile_close
Edward Thomson [Sat, 21 Jan 2017 22:16:28 +0000 (22:16 +0000)]
Merge pull request #4085 from libgit2/ethomson/packfile_close

indexer: introduce `git_packfile_close`

7 years agoindexer: avoid warning about `idx->pack`
Edward Thomson [Sat, 21 Jan 2017 20:44:57 +0000 (15:44 -0500)]
indexer: avoid warning about `idx->pack`

It must be non-NULL to have a valid `git_indexer`.

7 years agoindexer: introduce `git_packfile_close`
Edward Thomson [Sat, 21 Jan 2017 19:51:31 +0000 (14:51 -0500)]
indexer: introduce `git_packfile_close`

Encapsulation!

7 years agoMerge pull request #4016 from novalis/submodule-optimization
Edward Thomson [Sat, 21 Jan 2017 18:57:28 +0000 (18:57 +0000)]
Merge pull request #4016 from novalis/submodule-optimization

Submodule optimization

7 years agoMerge branch 'pr/4060'
Edward Thomson [Sat, 21 Jan 2017 18:30:12 +0000 (18:30 +0000)]
Merge branch 'pr/4060'

7 years agoindexer: only delete temp file if it was unused
Edward Thomson [Sat, 21 Jan 2017 17:15:33 +0000 (17:15 +0000)]
indexer: only delete temp file if it was unused

Only try to `unlink` our temp file when we know that we didn't copy it
into its permanent location.

7 years agoSkip submodule head/index update when caching.
Brock Peabody [Wed, 23 Nov 2016 23:32:55 +0000 (18:32 -0500)]
Skip submodule head/index update when caching.

`git_submodule_status` is very slow, bottlenecked on
`git_repository_head_tree`, which it uses through `submodule_update_head`.  If
the user has requested submodule caching, assume that they want this status
cached too and skip it.

Signed-off-by: David Turner <dturner@twosigma.com>
7 years agoAllow for caching of submodules.
Brock Peabody [Wed, 23 Nov 2016 23:32:48 +0000 (18:32 -0500)]
Allow for caching of submodules.

Added `git_repository_submodule_cache_all` to initialze a cache of
submodules on the repository so that operations looking up N
submodules are O(N) and not O(N^2).  Added a
`git_repository_submodule_cache_clear` function to remove the cache.

Also optimized the function that loads all submodules as it was itself
O(N^2) w.r.t the number of submodules, having to loop through the
`.gitmodules` file once per submodule.  I changed it to process the
`.gitmodules` file once, into a map.

Signed-off-by: David Turner <dturner@twosigma.com>
7 years agoFix formatting
David Turner [Wed, 23 Nov 2016 23:26:19 +0000 (18:26 -0500)]
Fix formatting

Signed-off-by: David Turner <dturner@twosigma.com>
7 years agoMerge pull request #4055 from ethomson/ethomson/ntlm
Carlos Martín Nieto [Mon, 16 Jan 2017 12:29:52 +0000 (12:29 +0000)]
Merge pull request #4055 from ethomson/ethomson/ntlm

WinHTTP: support best auth mechanism

7 years agoWinHTTP: support best auth mechanism
Edward Thomson [Fri, 30 Dec 2016 17:13:34 +0000 (12:13 -0500)]
WinHTTP: support best auth mechanism

For username/password credentials, support NTLM or Basic (in that order
of priority).  Use the WinHTTP built-in authentication support for both,
and maintain a bitfield of the supported mechanisms from the response.

7 years agoMerge pull request #4054 from jfultz/jfultz/fix_GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH
Edward Thomson [Sat, 14 Jan 2017 17:41:49 +0000 (17:41 +0000)]
Merge pull request #4054 from jfultz/jfultz/fix_GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH

Fix handling of GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH flag.

7 years agoMerge pull request #4061 from libgit2/ethomson/merge_opts
Carlos Martín Nieto [Sat, 14 Jan 2017 17:12:23 +0000 (17:12 +0000)]
Merge pull request #4061 from libgit2/ethomson/merge_opts

merge: set default rename threshold

7 years agoAddressed review feedback
lhchavez [Sat, 14 Jan 2017 16:37:00 +0000 (16:37 +0000)]
Addressed review feedback

7 years agoCHANGELOG: update `GIT_MERGE_OPTIONS_INIT` changes
Edward Thomson [Sat, 14 Jan 2017 16:01:53 +0000 (16:01 +0000)]
CHANGELOG: update `GIT_MERGE_OPTIONS_INIT` changes

7 years agopack: report revwalk error
Etienne Samson [Mon, 26 Dec 2016 21:15:31 +0000 (22:15 +0100)]
pack: report revwalk error

7 years agopatch: memory leak of patch.base.diff_opts.new|old_prefix
Etienne Samson [Mon, 26 Dec 2016 21:13:35 +0000 (22:13 +0100)]
patch: memory leak of patch.base.diff_opts.new|old_prefix

7 years agoignore: there must be a repository
Etienne Samson [Mon, 26 Dec 2016 13:47:55 +0000 (14:47 +0100)]
ignore: there must be a repository

Otherwise we'll NULL-dereference in git_attr_cache__init

7 years agoMerge pull request #4049 from libgit2/ethomson/error_msgs
Carlos Martín Nieto [Fri, 13 Jan 2017 16:05:58 +0000 (17:05 +0100)]
Merge pull request #4049 from libgit2/ethomson/error_msgs

giterr_set: consistent error messages

7 years agoexamples: general: fix memory leaks
Patrick Steinhardt [Thu, 12 Jan 2017 21:02:14 +0000 (22:02 +0100)]
examples: general: fix memory leaks

7 years agoexamples: general: display config only if it was found
Patrick Steinhardt [Thu, 12 Jan 2017 21:01:45 +0000 (22:01 +0100)]
examples: general: display config only if it was found

7 years agoexamples: general: narrow down scope of loop variables
Patrick Steinhardt [Thu, 12 Jan 2017 21:01:23 +0000 (22:01 +0100)]
examples: general: narrow down scope of loop variables

7 years agoexamples: general: clean up committer/author variables
Patrick Steinhardt [Thu, 12 Jan 2017 21:00:53 +0000 (22:00 +0100)]
examples: general: clean up committer/author variables

7 years agoMerge pull request #4074 from fcharlie/master
Edward Thomson [Wed, 11 Jan 2017 11:52:06 +0000 (11:52 +0000)]
Merge pull request #4074 from fcharlie/master

fix examples/network/clone.c: heap-buffer-overflow

7 years agoMerge remote-tracking branch 'upstream/maint/v0.25'
Carlos Martín Nieto [Mon, 9 Jan 2017 20:59:43 +0000 (20:59 +0000)]
Merge remote-tracking branch 'upstream/maint/v0.25'

7 years agoMerge pull request #4076 from libgit2/cmn/sec-update-25
Carlos Martín Nieto [Mon, 9 Jan 2017 20:26:45 +0000 (20:26 +0000)]
Merge pull request #4076 from libgit2/cmn/sec-update-25

security updates for v0.25

7 years agohttps: don't test that RC4 is invalid
Carlos Martín Nieto [Mon, 9 Jan 2017 17:53:21 +0000 (17:53 +0000)]
https: don't test that RC4 is invalid

None of our crypto backends actually reject RC4 as a cipher so don't
test for it and instead keep it as something we'd like to do.

7 years agohttp: correct the expected error for RC4
Carlos Martín Nieto [Mon, 9 Jan 2017 17:50:17 +0000 (17:50 +0000)]
http: correct the expected error for RC4

We must make sure that we're getting a certificate error from the
library so we know that we're testing the right thing.

7 years agofix examples/network/clone.c: heap-buffer-overflow
Force.Charlie-I [Mon, 9 Jan 2017 06:09:57 +0000 (14:09 +0800)]
fix examples/network/clone.c: heap-buffer-overflow

Format of a length of string to the correct format is:%.*s

7 years agoBump version to 0.25.1
Edward Thomson [Fri, 6 Jan 2017 17:15:53 +0000 (17:15 +0000)]
Bump version to 0.25.1

7 years agoMerge branch '25_smartpktparse' into maint/v0.25
Edward Thomson [Fri, 6 Jan 2017 17:12:16 +0000 (17:12 +0000)]
Merge branch '25_smartpktparse' into maint/v0.25

7 years agosmart_pkt: treat empty packet lines as error
Patrick Steinhardt [Tue, 15 Nov 2016 10:44:51 +0000 (11:44 +0100)]
smart_pkt: treat empty packet lines as error

The Git protocol does not specify what should happen in the case
of an empty packet line (that is a packet line "0004"). We
currently indicate success, but do not return a packet in the
case where we hit an empty line. The smart protocol was not
prepared to handle such packets in all cases, though, resulting
in a `NULL` pointer dereference.

Fix the issue by returning an error instead. As such kind of
packets is not even specified by upstream, this is the right
thing to do.

7 years agosmart_pkt: verify packet length exceeds PKT_LEN_SIZE
Patrick Steinhardt [Tue, 15 Nov 2016 10:36:27 +0000 (11:36 +0100)]
smart_pkt: verify packet length exceeds PKT_LEN_SIZE

Each packet line in the Git protocol is prefixed by a four-byte
length of how much data will follow, which we parse in
`git_pkt_parse_line`. The transmitted length can either be equal
to zero in case of a flush packet or has to be at least of length
four, as it also includes the encoded length itself. Not
checking this may result in a buffer overflow as we directly pass
the length to functions which accept a `size_t` length as
parameter.

Fix the issue by verifying that non-flush packets have at least a
length of `PKT_LEN_SIZE`.

7 years agoMerge branch '25_certcheckcb' into maint/v0.25
Edward Thomson [Fri, 6 Jan 2017 17:10:49 +0000 (17:10 +0000)]
Merge branch '25_certcheckcb' into maint/v0.25

7 years agohttp: perform 'badssl' check also via certificate callback
Carlos Martín Nieto [Fri, 6 Jan 2017 10:51:31 +0000 (10:51 +0000)]
http: perform 'badssl' check also via certificate callback

Make sure that the callbacks do also get a 'valid' value of zero when
the certificate we're looking at is in valid and assert that within the
test.

7 years agohttp: check certificate validity before clobbering the error variable
Etienne Samson [Wed, 21 Dec 2016 20:24:33 +0000 (21:24 +0100)]
http: check certificate validity before clobbering the error variable