]> git.proxmox.com Git - libgit2.git/log
libgit2.git
8 years agothreads: add platform-independent thread initialization function
Patrick Steinhardt [Mon, 20 Jun 2016 18:07:33 +0000 (20:07 +0200)]
threads: add platform-independent thread initialization function

8 years agowin32: rename pthread.{c,h} to thread.{c,h}
Patrick Steinhardt [Mon, 20 Jun 2016 16:21:42 +0000 (18:21 +0200)]
win32: rename pthread.{c,h} to thread.{c,h}

The old pthread-file did re-implement the pthreads API with exact symbol
matching. As the thread-abstraction has now been split up between Unix- and
Windows-specific files within the `git_` namespace to avoid symbol-clashes
between libgit2 and pthreads, the rewritten wrappers have nothing to do with
pthreads anymore.

Rename the Windows-specific pthread-files to honor this change.

8 years agothreads: remove now-useless typedefs
Patrick Steinhardt [Mon, 20 Jun 2016 16:28:00 +0000 (18:28 +0200)]
threads: remove now-useless typedefs

8 years agothreads: remove unused function pthread_num_processors_np
Patrick Steinhardt [Mon, 20 Jun 2016 17:40:45 +0000 (19:40 +0200)]
threads: remove unused function pthread_num_processors_np

The function pthread_num_processors_np is currently unused and superseded by the
function `git_online_cpus`. Remove the function.

8 years agothreads: split up OS-dependent rwlock code
Patrick Steinhardt [Mon, 20 Jun 2016 15:49:47 +0000 (17:49 +0200)]
threads: split up OS-dependent rwlock code

8 years agothreads: split up OS-dependent thread-condition code
Patrick Steinhardt [Mon, 20 Jun 2016 15:20:13 +0000 (17:20 +0200)]
threads: split up OS-dependent thread-condition code

8 years agothreads: remove unused function pthread_cond_broadcast
Patrick Steinhardt [Mon, 20 Jun 2016 17:48:19 +0000 (19:48 +0200)]
threads: remove unused function pthread_cond_broadcast

8 years agothreads: split up OS-dependent mutex code
Patrick Steinhardt [Mon, 20 Jun 2016 15:07:14 +0000 (17:07 +0200)]
threads: split up OS-dependent mutex code

8 years agothreads: split up OS-dependent thread code
Patrick Steinhardt [Mon, 20 Jun 2016 15:44:04 +0000 (17:44 +0200)]
threads: split up OS-dependent thread code

8 years agoMerge pull request #3823 from libgit2/ethomson/checkout_no_index
Carlos Martín Nieto [Fri, 17 Jun 2016 13:45:55 +0000 (15:45 +0200)]
Merge pull request #3823 from libgit2/ethomson/checkout_no_index

checkout: use empty baseline when no index file exists

8 years agoMerge pull request #3822 from libgit2/ethomson/checkout_head_docs
Carlos Martín Nieto [Thu, 16 Jun 2016 06:53:30 +0000 (08:53 +0200)]
Merge pull request #3822 from libgit2/ethomson/checkout_head_docs

documentation: improve docs for `checkout_head`

8 years agocheckout: use empty baseline when no index
Edward Thomson [Wed, 15 Jun 2016 20:47:28 +0000 (15:47 -0500)]
checkout: use empty baseline when no index

When no index file exists and a baseline is not explicitly provided, use
an empty baseline instead of trying to load `HEAD`.

8 years agodocumentation: improve docs for `checkout_head`
Edward Thomson [Tue, 14 Jun 2016 17:27:03 +0000 (12:27 -0500)]
documentation: improve docs for `checkout_head`

`git_checkout_head` is sadly misunderstood as something that can
switch branches.  It cannot.  Update the documentation to reflect this.

8 years agoMerge pull request #3812 from stinb/fetch-tag-update-callback
Edward Thomson [Tue, 14 Jun 2016 21:42:00 +0000 (11:42 -1000)]
Merge pull request #3812 from stinb/fetch-tag-update-callback

fetch: Fixed spurious update callback for existing tags.

8 years agofetch: Fixed spurious update callback for existing tags.
Jason Haslam [Tue, 14 Jun 2016 20:46:12 +0000 (14:46 -0600)]
fetch: Fixed spurious update callback for existing tags.

8 years agoMerge pull request #3816 from pks-t/pks/memory-leaks
Edward Thomson [Tue, 14 Jun 2016 14:33:55 +0000 (04:33 -1000)]
Merge pull request #3816 from pks-t/pks/memory-leaks

Memory leak fixes

8 years agoMerge pull request #3814 from pks-t/pks/invalid-memrefs
Edward Thomson [Tue, 14 Jun 2016 14:10:11 +0000 (04:10 -1000)]
Merge pull request #3814 from pks-t/pks/invalid-memrefs

Fix invalid memory references

8 years agowinhttp: plug several memory leaks
Patrick Steinhardt [Tue, 7 Jun 2016 12:14:07 +0000 (14:14 +0200)]
winhttp: plug several memory leaks

8 years agoglobal: clean up crt only after freeing tls data
Patrick Steinhardt [Tue, 7 Jun 2016 10:55:17 +0000 (12:55 +0200)]
global: clean up crt only after freeing tls data

The thread local storage is used to hold some global state that
is dynamically allocated and should be freed upon exit. On
Windows, we clean up the C run-time right after execution of
registered shutdown callbacks and before cleaning up the TLS.

When we clean up the CRT, we also cause it to analyze for memory
leaks. As we did not free the TLS yet this will lead to false
positives.

Fix the issue by first freeing the TLS and cleaning up the CRT
only afterwards.

8 years agotests: fix memory leaks in checkout::typechange
Patrick Steinhardt [Tue, 7 Jun 2016 10:29:16 +0000 (12:29 +0200)]
tests: fix memory leaks in checkout::typechange

8 years agoindex: fix NULL pointer access in index_remove_entry
Patrick Steinhardt [Tue, 7 Jun 2016 06:35:26 +0000 (08:35 +0200)]
index: fix NULL pointer access in index_remove_entry

When removing an entry from the index by its position, we first
retrieve the position from the index's entries and then try to
remove the retrieved value from the index map with
`DELETE_IN_MAP`. When `index_remove_entry` returns `NULL` we try
to feed it into the `DELETE_IN_MAP` macro, which will
unconditionally call `idxentry_hash` and then happily dereference
the `NULL` entry pointer.

Fix the issue by not passing a `NULL` entry into `DELETE_IN_MAP`.

8 years agotransports: smart: fix potential invalid memory dereferences
Patrick Steinhardt [Mon, 6 Jun 2016 10:59:17 +0000 (12:59 +0200)]
transports: smart: fix potential invalid memory dereferences

When we receive a packet of exactly four bytes encoding its
length as those four bytes it can be treated as an empty line.
While it is not really specified how those empty lines should be
treated, we currently ignore them and do not return an error when
trying to parse it but simply advance the data pointer.

Callers invoking `git_pkt_parse_line` are currently not prepared
to handle this case as they do not explicitly check this case.
While they could always reset the passed out-pointer to `NULL`
before calling `git_pkt_parse_line` and determine if the pointer
has been set afterwards, it makes more sense to update
`git_pkt_parse_line` to set the out-pointer to `NULL` itself when
it encounters such an empty packet. Like this it is guaranteed
that there will be no invalid memory references to free'd
pointers.

As such, the issue has been fixed such that `git_pkt_parse_line`
always sets the packet out pointer to `NULL` when an empty packet
has been received and callers check for this condition, skipping
such packets.

8 years agoMerge pull request #3808 from ethomson/read_index_fixes
Edward Thomson [Thu, 2 Jun 2016 08:08:26 +0000 (03:08 -0500)]
Merge pull request #3808 from ethomson/read_index_fixes

`git_index_read_index` fixes

8 years agoindex_read_index: invalidate new paths in tree cache
Edward Thomson [Thu, 2 Jun 2016 07:34:03 +0000 (02:34 -0500)]
index_read_index: invalidate new paths in tree cache

When adding a new entry to an existing index via `git_index_read_index`,
be sure to remove the tree cache entry for that new path.  This will
mark all parent trees as dirty.

8 years agorebase: test rebasing a new commit with subfolder
Edward Thomson [Thu, 2 Jun 2016 06:58:25 +0000 (01:58 -0500)]
rebase: test rebasing a new commit with subfolder

Test a rebase (both a merge rebase and an inmemory rebase) with a new
commit that adds files underneath a new subfolder.

8 years agotest: ensure we can round-trip a written tree
Edward Thomson [Thu, 2 Jun 2016 03:31:16 +0000 (22:31 -0500)]
test: ensure we can round-trip a written tree

Read a tree into an index, write the index, then re-open the index and
ensure that we are treesame to the original.

8 years agoindex_read_index: set flags for path_len correctly
Edward Thomson [Thu, 2 Jun 2016 06:04:58 +0000 (01:04 -0500)]
index_read_index: set flags for path_len correctly

Update the flags to reset the path_len (to emulate `index_insert`)

8 years agoindex_read_index: differentiate on mode
Edward Thomson [Thu, 2 Jun 2016 05:47:51 +0000 (00:47 -0500)]
index_read_index: differentiate on mode

Treat index entries with different modes as different, which they
are, at least for the purposes of up-to-date calculations.

8 years agoindex_read_index: reset error correctly
Edward Thomson [Wed, 1 Jun 2016 19:56:27 +0000 (14:56 -0500)]
index_read_index: reset error correctly

Clear any error state upon each iteration.  If one of the iterations
ends (with an error of `GIT_ITEROVER`) we need to reset that error to 0,
lest we stop the whole process prematurely.

8 years agoround-trip trees through index_read_index
Edward Thomson [Wed, 1 Jun 2016 19:52:25 +0000 (14:52 -0500)]
round-trip trees through index_read_index

Read a tree into an index using `git_index_read_index` (by reading
a tree into a new index, then reading that index into the current
index), then write the index back out, ensuring that our new index
is treesame to the tree that we read.

8 years agoMerge pull request #3796 from mmuman/haiku
Edward Thomson [Wed, 1 Jun 2016 16:33:58 +0000 (11:33 -0500)]
Merge pull request #3796 from mmuman/haiku

Preliminary Haiku port

8 years agoMerge pull request #3801 from ethomson/warning
Edward Thomson [Wed, 1 Jun 2016 16:05:45 +0000 (11:05 -0500)]
Merge pull request #3801 from ethomson/warning

cleanup: unused warning

8 years agowin32: clean up unused warnings in DllMain
Edward Thomson [Thu, 26 May 2016 17:52:29 +0000 (12:52 -0500)]
win32: clean up unused warnings in DllMain

8 years agorebase: change assertion to avoid
Edward Thomson [Thu, 26 May 2016 17:42:43 +0000 (12:42 -0500)]
rebase: change assertion to avoid

It looks like we're getting the operation and not doing anything
with it, when in fact we are asserting that it's not null.  Simply
assert that we are within the operation boundary instead of using
the `git_array_get` macro to do this for us.

8 years agofilebuf: fix uninitialized warning
Edward Thomson [Thu, 26 May 2016 17:39:09 +0000 (12:39 -0500)]
filebuf: fix uninitialized warning

8 years agocheckout: drop unused repo
Edward Thomson [Thu, 26 May 2016 17:28:32 +0000 (12:28 -0500)]
checkout: drop unused repo

8 years agocleanup: unused warning
Edward Thomson [Thu, 26 May 2016 15:51:16 +0000 (10:51 -0500)]
cleanup: unused warning

8 years agoMerge pull request #3803 from glensc/patch-1
Edward Thomson [Fri, 27 May 2016 14:15:01 +0000 (09:15 -0500)]
Merge pull request #3803 from glensc/patch-1

Update CMakeLists.txt

8 years agoUpdate CMakeLists.txt
Elan Ruusamäe [Fri, 27 May 2016 07:20:35 +0000 (10:20 +0300)]
Update CMakeLists.txt

typo fix

8 years agoMerge pull request #3799 from sschuberth/master
Edward Thomson [Thu, 26 May 2016 15:28:00 +0000 (10:28 -0500)]
Merge pull request #3799 from sschuberth/master

Use AppVeyor's Start-FileDownload cmdlet

8 years agoMerge pull request #3798 from mmuman/stat-test-fix
Edward Thomson [Thu, 26 May 2016 15:25:40 +0000 (10:25 -0500)]
Merge pull request #3798 from mmuman/stat-test-fix

test: Fix stat() test to mask out unwanted bits

8 years agoMerge branch 'checkout_submodules'
Edward Thomson [Thu, 26 May 2016 06:20:41 +0000 (01:20 -0500)]
Merge branch 'checkout_submodules'

8 years agoIgnore submodules when checking for merge conflicts in the workdir.
Jason Haslam [Thu, 12 May 2016 19:18:07 +0000 (13:18 -0600)]
Ignore submodules when checking for merge conflicts in the workdir.

8 years agocheckout: handle dirty submodules correctly
Jason Haslam [Wed, 17 Feb 2016 04:02:41 +0000 (21:02 -0700)]
checkout: handle dirty submodules correctly

Don't generate conflicts when checking out a modified submodule and the
submodule is dirty or modified in the workdir.

8 years agoMerge pull request #3792 from edquist/misc
Edward Thomson [Thu, 26 May 2016 05:58:43 +0000 (00:58 -0500)]
Merge pull request #3792 from edquist/misc

Fix comment for GIT_FILEMODE_LINK

8 years agoUse AppVeyor's Start-FileDownload cmdlet
Sebastian Schuberth [Wed, 25 May 2016 10:10:44 +0000 (12:10 +0200)]
Use AppVeyor's Start-FileDownload cmdlet

Start-FileDownload maintains current directory context and allows
specifying a request timeout, see [1].

[1] https://www.appveyor.com/docs/how-to/download-file#start-filedownload-cmdlet

8 years agotest: Fix stat() test to mask out unwanted bits
François Revol [Tue, 24 May 2016 17:07:09 +0000 (19:07 +0200)]
test: Fix stat() test to mask out unwanted bits

Haiku and Hurd both pass extra bits in struct stat::st_mode.

8 years agoMerge pull request #3797 from libgit2/cmn/remove-single-entry
Carlos Martín Nieto [Tue, 24 May 2016 14:15:57 +0000 (16:15 +0200)]
Merge pull request #3797 from libgit2/cmn/remove-single-entry

tree: handle removal of all entries in the updater

8 years agotree: handle removal of all entries in the updater
Carlos Martín Nieto [Tue, 24 May 2016 12:30:43 +0000 (14:30 +0200)]
tree: handle removal of all entries in the updater

When we remove all entries in a tree, we should remove that tree from
its parent rather than include the empty tree.

8 years agoMerge pull request #3794 from libgit2/cmn/tree-update-basename
Carlos Martín Nieto [Mon, 23 May 2016 16:02:24 +0000 (18:02 +0200)]
Merge pull request #3794 from libgit2/cmn/tree-update-basename

Tree updater fixups

8 years agoCMakeLists: Add libnetwork for Haiku
François Revol [Sun, 22 May 2016 21:23:58 +0000 (23:23 +0200)]
CMakeLists: Add libnetwork for Haiku

8 years agotree: plug leaks in the tree updater
Carlos Martín Nieto [Thu, 19 May 2016 13:29:53 +0000 (15:29 +0200)]
tree: plug leaks in the tree updater

8 years agotree: use the basename for the entry removal
Carlos Martín Nieto [Thu, 19 May 2016 13:22:02 +0000 (15:22 +0200)]
tree: use the basename for the entry removal

When we want to remove the file, use the basename as the name of the
entry to remove, instead of the full one, which includes the directories
we've inserted into the stack.

8 years agotree: use testrepo2 for the tree updater tests
Carlos Martín Nieto [Thu, 19 May 2016 13:21:26 +0000 (15:21 +0200)]
tree: use testrepo2 for the tree updater tests

This gives us trees with subdirectories, which the new test needs.

8 years agoFix comment for GIT_FILEMODE_LINK
Carl Edquist [Wed, 18 May 2016 21:00:01 +0000 (16:00 -0500)]
Fix comment for GIT_FILEMODE_LINK

0120000 is symbolic link, not commit

8 years agoMerge pull request #3770 from libgit2/cmn/tree-update
Edward Thomson [Wed, 18 May 2016 16:30:02 +0000 (11:30 -0500)]
Merge pull request #3770 from libgit2/cmn/tree-update

Add a method specifically for modifying trees

8 years agoIntroduce a function to create a tree based on a different one
Carlos Martín Nieto [Mon, 2 May 2016 15:36:58 +0000 (17:36 +0200)]
Introduce a function to create a tree based on a different one

Instead of going through the usual steps of reading a tree recursively
into an index, modifying it and writing it back out as a tree, introduce
a function to perform simple updates more efficiently.

`git_tree_create_updated` avoids reading trees which are not modified
and supports upsert and delete operations. It is not as versatile as
modifying the index, but it makes some common operations much more
efficient.

8 years agoMerge pull request #3767 from pks-t/pks/misc-fixes
Edward Thomson [Mon, 9 May 2016 13:58:44 +0000 (08:58 -0500)]
Merge pull request #3767 from pks-t/pks/misc-fixes

Misc fixes

8 years agoMerge pull request #3773 from lucasderraugh/patch-1
Edward Thomson [Sun, 8 May 2016 22:48:22 +0000 (17:48 -0500)]
Merge pull request #3773 from lucasderraugh/patch-1

Fix unused variable 'message' warning

8 years agoMerge pull request #3757 from johnhaley81/jh/fix-create-initial-commit
Carlos Martín Nieto [Fri, 6 May 2016 16:44:37 +0000 (18:44 +0200)]
Merge pull request #3757 from johnhaley81/jh/fix-create-initial-commit

Fix `git_commit_create` for an initial commit

8 years agoFix unused variable 'message' warning
Lucas Derraugh [Fri, 6 May 2016 03:34:23 +0000 (23:34 -0400)]
Fix unused variable 'message' warning

8 years agoFix initial commit test
John Haley [Wed, 4 May 2016 18:14:17 +0000 (11:14 -0700)]
Fix initial commit test

`test_commit_commit__create_initial_commit_parent_not_current` was not correctly
testing that `HEAD` was not changed. Now we grab the oid that it was pointing to
before the call to `git_commit_create` and the oid that it's pointing to afterwards
and compare those.

8 years agoMerge pull request #3769 from libgit2/ethomson/rebase_inmemory_no_base
Carlos Martín Nieto [Wed, 4 May 2016 17:05:38 +0000 (19:05 +0200)]
Merge pull request #3769 from libgit2/ethomson/rebase_inmemory_no_base

Rebase: rebase a branch with no merge base for in-memory

8 years agoAdd tests for creating an initial commit
John Haley [Tue, 3 May 2016 20:32:22 +0000 (13:32 -0700)]
Add tests for creating an initial commit

8 years agoFix `git_commit_create` for an initial commit
John Haley [Tue, 26 Apr 2016 15:09:04 +0000 (08:09 -0700)]
Fix `git_commit_create` for an initial commit

When calling `git_commit_create` with an empty array of `parents` and `parent_count == 0`
the call will segfault at https://github.com/libgit2/libgit2/blob/master/src/commit.c#L107
when it's trying to compare `current_id` to a null parent oid.

This just puts in a check to stop that segfault.

8 years agorebase: handle no common ancestor for inmemory
Edward Thomson [Tue, 3 May 2016 19:29:50 +0000 (15:29 -0400)]
rebase: handle no common ancestor for inmemory

8 years agorebase: test rebase (merge) w/ no common ancestor
Edward Thomson [Tue, 3 May 2016 19:22:22 +0000 (15:22 -0400)]
rebase: test rebase (merge) w/ no common ancestor

8 years agodiff: simplify code for handling empty dirs
Patrick Steinhardt [Tue, 3 May 2016 15:36:09 +0000 (17:36 +0200)]
diff: simplify code for handling empty dirs

When determining diffs between two iterators we may need to
recurse into an unmatched directory for the "new" iterator when
it is either a prefix to the current item of the "old" iterator
or when untracked/ignored changes are requested by the user and
the directory is untracked/ignored.

When advancing into the directory and no files are found, we will
get back `GIT_ENOTFOUND`. If so, we simply skip the directory,
handling resulting unmatched old items in the next iteration. The
other case of `iterator_advance_into` returning either
`GIT_NOERROR` or any other error but `GIT_ENOTFOUND` will be
handled by the caller, which will now either compare the first
directory entry of the "new" iterator in case of `GIT_ENOERROR`
or abort on other cases.

Improve readability of the code to make the above logic more
clear.

8 years agoMerge pull request #3759 from libgit2/cmn/faster-header
Edward Thomson [Mon, 2 May 2016 17:59:51 +0000 (13:59 -0400)]
Merge pull request #3759 from libgit2/cmn/faster-header

odb: avoid inflating the full delta to read the header

8 years agodelta-apply: fix sign extension
Patrick Steinhardt [Mon, 2 May 2016 14:49:59 +0000 (16:49 +0200)]
delta-apply: fix sign extension

We compute offsets by executing `off |= (*delta++ << 24)` for
multiple constants, where `off` is of type `size_t` and `delta`
is of type `unsigned char`. The usual arithmetic conversions (see
ISO C89 §3.2.1.5 "Usual arithmetic conversions") kick in here,
causing us to promote both operands to `int` and then extending
the result to an `unsigned long` when OR'ing it with `off`.
The integer promotion to `int` may result in wrong size
calculations for big values.

Fix the issue by making the constants `unsigned long`, causing both
operands to be promoted to `unsigned long`.

8 years agoodb_loose: fix undefined behavior when computing size
Patrick Steinhardt [Mon, 2 May 2016 14:24:14 +0000 (16:24 +0200)]
odb_loose: fix undefined behavior when computing size

An object's size is computed by reading the object header's size
field until the most significant bit is not set anymore. To get
the total size, we increase the shift on each iteration and add
the shifted value to the total size.

We read the current value into a variable of type `unsigned
char`, from which we then take all bits except the most
significant bit and shift the result. We will end up with a
maximum shift of 60, but this exceeds the width of the value's
type, resulting in undefined behavior.

Fix the issue by instead reading the values into a variable of
type `unsigned long`, which matches the required width. This is
equivalent to git.git, which uses an `unsigned long` as well.

8 years agocheckout: set ignorecase=0 when config lookup fails
Patrick Steinhardt [Mon, 2 May 2016 13:47:54 +0000 (15:47 +0200)]
checkout: set ignorecase=0 when config lookup fails

When `git_repository__cvar` fails we may end up with a
`ignorecase` value of `-1`. As we subsequently check if
`ignorecase` is non-zero, we may end up reporting that data
should be removed when in fact it should not.

Err on the safer side and set `ignorecase = 0` when
`git_repository__cvar` fails.

8 years agomerge_file: do not unnecessarily check ours/theirs for NULL
Patrick Steinhardt [Mon, 2 May 2016 12:46:14 +0000 (14:46 +0200)]
merge_file: do not unnecessarily check ours/theirs for NULL

The `merge_file__xdiff` function checks if either `ours` or
`theirs` is `NULL`. The function is to be called with existing
files, though, and in fact already unconditionally dereferences
both pointers.

Remove the unnecessary check to silence warnings.

8 years agoodb: avoid inflating the full delta to read the header
Carlos Martín Nieto [Wed, 27 Apr 2016 10:00:31 +0000 (12:00 +0200)]
odb: avoid inflating the full delta to read the header

When we read the header, we want to know the size and type of the
object. We're currently inflating the full delta in order to read the
first few bytes. This can mean hundreds of kB needlessly inflated for
large objects.

Instead use a packfile stream to read just enough so we can read the two
varints in the header and avoid inflating most of the delta.

8 years agoindex: fix memory leak on error case
Patrick Steinhardt [Mon, 2 May 2016 12:30:14 +0000 (14:30 +0200)]
index: fix memory leak on error case

8 years agoMerge pull request #3764 from libgit2/ethomson/cmake_pc
Carlos Martín Nieto [Fri, 29 Apr 2016 16:34:03 +0000 (18:34 +0200)]
Merge pull request #3764 from libgit2/ethomson/cmake_pc

cmake: include threading libraries in pkg-config

8 years agocmake: include threading libraries in pkg-config
Edward Thomson [Fri, 29 Apr 2016 14:18:04 +0000 (10:18 -0400)]
cmake: include threading libraries in pkg-config

Include any required threading libraries in our `libgit2.pc`.

8 years agoMerge pull request #3763 from libgit2/ethomson/signature_from_buffer
Carlos Martín Nieto [Fri, 29 Apr 2016 08:36:01 +0000 (10:36 +0200)]
Merge pull request #3763 from libgit2/ethomson/signature_from_buffer

Introduce `git_signature_from_buffer`

8 years agoMerge pull request #3760 from backhub/bug/openssl_read
Edward Thomson [Fri, 29 Apr 2016 02:32:20 +0000 (22:32 -0400)]
Merge pull request #3760 from backhub/bug/openssl_read

Fix return value of openssl_read (infinite loop)

8 years agoIntroduce `git_signature_from_buffer`
Edward Thomson [Thu, 28 Apr 2016 16:47:14 +0000 (12:47 -0400)]
Introduce `git_signature_from_buffer`

Allow users to construct a signature from the type of signature
lines that actually appear in commits.

8 years agoFix style: no braces
Christian Schlack [Wed, 27 Apr 2016 11:56:16 +0000 (13:56 +0200)]
Fix style: no braces

8 years agoMerge pull request #3758 from libgit2/ethomson/annotated_commit_refs
Carlos Martín Nieto [Tue, 26 Apr 2016 19:21:27 +0000 (21:21 +0200)]
Merge pull request #3758 from libgit2/ethomson/annotated_commit_refs

Annotated commits: differentiate between the ref names and the description

8 years agoannotated_commit: provide refs and description
Edward Thomson [Tue, 26 Apr 2016 15:39:53 +0000 (11:39 -0400)]
annotated_commit: provide refs and description

Differentiate between the ref_name used to create an annotated_commit
(that can subsequently be used to look up the reference) and the
description that we resolved this with (which _cannot_ be looked up).

The description is used for things like reflogs (and may be a ref name,
and ID something that we revparsed to get here), while the ref name must
actually be a reference name, and is used for things like rebase to
return to the initial branch.

8 years agoFix return value of openssl_read (infinite loop)
Christian Schlack [Tue, 26 Apr 2016 16:04:03 +0000 (18:04 +0200)]
Fix return value of openssl_read (infinite loop)

openssl_read should return -1 in case of error.

SSL_read returns values <= 0 in case of error.

A return value of 0 can lead to an infinite loop, so the return value
of ssl_set_error will be returned if SSL_read is not successful (analog
to openssl_write).

8 years agorebase::abort: test we can abort rebase by revspec
Edward Thomson [Tue, 26 Apr 2016 15:48:11 +0000 (11:48 -0400)]
rebase::abort: test we can abort rebase by revspec

Test that we can properly abort a rebase when it is initialized by a
revspec.  This ensures that we do not conflate revspecs and refnames.

8 years agoMerge pull request #3755 from arthurschreiber/patch-9
Carlos Martín Nieto [Tue, 26 Apr 2016 11:40:03 +0000 (13:40 +0200)]
Merge pull request #3755 from arthurschreiber/patch-9

Remove traces of `git_blob_create_fromchunks`

8 years agoRemove traces of `git_blob_create_fromchunks`
Arthur Schreiber [Tue, 26 Apr 2016 09:10:31 +0000 (11:10 +0200)]
Remove traces of `git_blob_create_fromchunks`

8 years agoMerge pull request #3749 from arthurschreiber/arthur/add-git-reference-dup
Carlos Martín Nieto [Tue, 26 Apr 2016 09:02:45 +0000 (11:02 +0200)]
Merge pull request #3749 from arthurschreiber/arthur/add-git-reference-dup

Allow creating copies of `git_reference` objects.

8 years agoMerge pull request #3748 from libgit2/ethomson/rebase_detached
Carlos Martín Nieto [Tue, 26 Apr 2016 09:02:05 +0000 (11:02 +0200)]
Merge pull request #3748 from libgit2/ethomson/rebase_detached

Rebase improvements with IDs

8 years agoMerge pull request #3752 from libgit2/cmn/silly-tags
Edward Thomson [Mon, 25 Apr 2016 13:45:27 +0000 (09:45 -0400)]
Merge pull request #3752 from libgit2/cmn/silly-tags

tag: ignore extra header fields

8 years agotag: ignore extra header fields
Carlos Martín Nieto [Mon, 25 Apr 2016 10:16:05 +0000 (12:16 +0200)]
tag: ignore extra header fields

While no extra header fields are defined for tags, git accepts them by
ignoring them and continuing the search for the message. There are a few
tags like this in the wild which git parses just fine, so we should do
the same.

8 years agoAllow creating copies of `git_reference` objects.
Arthur Schreiber [Fri, 22 Apr 2016 17:34:17 +0000 (10:34 -0700)]
Allow creating copies of `git_reference` objects.

8 years agoMerge pull request #3747 from libgit2/ethomson/warnings
Carlos Martín Nieto [Fri, 22 Apr 2016 13:40:08 +0000 (15:40 +0200)]
Merge pull request #3747 from libgit2/ethomson/warnings

:zap: some warnings

8 years agorebase: correctly finish rebasing detached heads
Edward Thomson [Thu, 21 Apr 2016 22:16:37 +0000 (18:16 -0400)]
rebase: correctly finish rebasing detached heads

When rebasing with IDs, we do not return to the `branch`,
we remain in a detached HEAD state.

8 years agorebase: handle detached HEADs in `init`
Edward Thomson [Thu, 21 Apr 2016 21:29:19 +0000 (17:29 -0400)]
rebase: handle detached HEADs in `init`

When `init`ing a rebase from a detached HEAD, be sure to remember
that we were in a detached HEAD state so that we can correctly
`abort` the object that we just created.

8 years agorebase: test abort immediately after init
Edward Thomson [Thu, 21 Apr 2016 21:03:21 +0000 (17:03 -0400)]
rebase: test abort immediately after init

Instead of `open`ing a rebase and `abort`ing that, test that we can
`abort` a rebase that has just begun with `init`.

8 years agoclone test: annotate unused vars
Edward Thomson [Thu, 21 Apr 2016 15:05:21 +0000 (11:05 -0400)]
clone test: annotate unused vars

8 years agotransport: cast away constness for free
Edward Thomson [Thu, 21 Apr 2016 15:02:31 +0000 (11:02 -0400)]
transport: cast away constness for free

8 years agostransport: pass proxy opts instead of char*
Edward Thomson [Thu, 21 Apr 2016 15:01:09 +0000 (11:01 -0400)]
stransport: pass proxy opts instead of char*

8 years agoiterator: ignore submodule in has_ended
Edward Thomson [Thu, 21 Apr 2016 14:58:22 +0000 (10:58 -0400)]
iterator: ignore submodule in has_ended