Commit Graph

9080 Commits

Author SHA1 Message Date
Carlos Martín Nieto
c8fe6c0975 openssl: re-export the last-resort locking function
We need to include the header where we define the function. Otherwise it
won't be available on the DLL.
2016-02-19 16:23:14 +01:00
Carlos Martín Nieto
f596946f09 CHANGELOG: add a few missing changes 2016-02-19 13:52:04 +01:00
Carlos Martín Nieto
deecaa2ece openssl: free the context even if we don't connect 2016-02-19 13:34:52 +01:00
Carlos Martín Nieto
bf127eec4a global: remove an unused variable 2016-02-19 13:24:41 +01:00
Carlos Martín Nieto
78e16c3442 Merge pull request #3597 from ethomson/filter_registration
Filter registration
2016-02-19 13:06:51 +01:00
Carlos Martín Nieto
b643501dba Merge pull request #3614 from pks-t/pks/coverity-fixes
Coverity fixes
2016-02-19 10:21:37 +01:00
Patrick Steinhardt
8a62bf1180 netops: fix memory leak when an error occurs 2016-02-18 20:50:33 +01:00
Patrick Steinhardt
b0f7512f40 transports: smart_pkt: fix memory leaks 2016-02-18 20:50:33 +01:00
Patrick Steinhardt
704554cdf0 transports: smart: fix memory leak on OOM path 2016-02-18 20:50:33 +01:00
Patrick Steinhardt
038d7af085 signature: use GITERR_CHECK_ALLOC to check for OOM situation
When checking for out of memory situations we usually use the
GITERR_CHECK_ALLOC macro. Besides conforming to our current code
base it adds the benefit of silencing errors in Coverity due to
Coverity handling the macro's error path as abort.
2016-02-18 20:50:33 +01:00
Patrick Steinhardt
40f6f22517 coverity: hint that string length is at least 2
When checking if a string is prefixed by a drive letter (e.g.
"C:") we verify this by inspecting the first and second character
of the string. Coverity thinks this is a defect as we do not
check the string's length first, but in fact we only check the
second character if the first character is part of the alphabet,
that is it cannot be '\0'.

Fix this by overriding the macro and explicitly checking the
string's length.
2016-02-18 20:50:33 +01:00
Patrick Steinhardt
5981ab1d70 coverity: add nodefs for abort macros
Add nodefs for macros that abort the current flow due to errors.
This includes macros that trigger on integer overflows and for
the version check macro. This aids Coverity as we point out that
these paths will cause a fatal error.
2016-02-18 20:50:33 +01:00
Carlos Martín Nieto
c1b75f05ad Merge pull request #3604 from ethomson/nsec_xplat
Handle `USE_NSECS`
2016-02-18 15:11:31 +01:00
Carlos Martín Nieto
b85d0afd6e Merge pull request #3606 from ethomson/drop_xp
win32: drop xp support in WideCharToMultiByte
2016-02-18 15:11:02 +01:00
Carlos Martín Nieto
5663d4f691 Merge pull request #3613 from ethomson/fixups
Remove most of the silly warnings
2016-02-18 12:31:56 +01:00
Carlos Martín Nieto
594a5d12d4 Merge pull request #3619 from ethomson/win32_forbidden
win32: allow us to read indexes with forbidden paths on win32
2016-02-18 12:28:06 +01:00
Carlos Martín Nieto
298d1b07af Merge pull request #3621 from pra85/patch-1
Fix a typo
2016-02-18 11:44:04 +01:00
Carlos Martín Nieto
9c26f90c37 PROJECTS: remove a few things we do have 2016-02-18 11:39:55 +01:00
Prayag Verma
d50bf71694 Fix a typo
`compatability` → `compatibility`
2016-02-18 13:26:08 +05:30
Edward Thomson
318b825e76 index: allow read of index w/ illegal entries
Allow `git_index_read` to handle reading existing indexes with
illegal entries.  Allow the low-level `git_index_add` to add
properly formed `git_index_entry`s even if they contain paths
that would be illegal for the current filesystem (eg, `AUX`).
Continue to disallow `git_index_add_bypath` from adding entries
that are illegal universally illegal (eg, `.git`, `foo/../bar`).
2016-02-17 13:10:33 +00:00
Edward Thomson
4fea9cffbd iterator: assert tree_iterator has a frame
Although a `tree_iterator` that failed to be properly created
does not have a frame, all other `tree_iterator`s should.  Do not
call `pop` in the failure case, but assert that in all other
cases there is a frame.
2016-02-17 13:10:33 +00:00
Colin Xu
a218b2f625 Validate pointer before access the member.
When Git repository at network locations, sometimes git_iterator_for_tree
fails at iterator__update_ignore_case so it goes to git_iterator_free.
Null pointer will crash the process if not check.

Signed-off-by: Colin Xu <colin.xu@gmail.com>
2016-02-17 13:10:33 +00:00
Edward Thomson
4be2aa57c9 win32: tests around handling forbidden paths
Introduce a repository that contains some paths that were illegal
on PC-DOS circa 1981 (like `aux`, `con`, `com1`) and that in a
bizarre fit of retrocomputing, remain illegal on some "modern"
computers, despite being "new technology".

Introduce some aspirational tests that suggest that we should be
able to cope with trees and indexes that contain paths that
would be illegal on the filesystem, so that we can at least diff
them.  Further ensure that checkout will not write a repository
with forbidden paths.
2016-02-17 13:10:33 +00:00
Carlos Martín Nieto
474bd2c160 Merge pull request #3617 from libgit2/cmn/extract-sig-errors
commit: expose the different kinds of errors
2016-02-16 14:45:32 +01:00
Carlos Martín Nieto
eadd0f05f6 commit: expose the different kinds of errors
We should be checking whether the object we're looking up is a commit,
and we should let the caller know whether the not-found return code
comes from a bad object type or just a missing signature.
2016-02-16 14:06:48 +01:00
Edward Thomson
9ce0399c4d winhttp: use an unsigned iterator 2016-02-16 11:50:49 +00:00
Edward Thomson
3b2fa0fb36 submodule: explicitly cast to the teensy time value 2016-02-16 11:50:48 +00:00
Edward Thomson
b2ca8d9c29 index: explicitly cast the teeny index entry members 2016-02-16 11:50:47 +00:00
Edward Thomson
997e030154 index: don't use seek return as an error code 2016-02-16 11:50:47 +00:00
Edward Thomson
9a634cba85 index: explicitly cast new hash size to an int 2016-02-16 11:50:46 +00:00
Edward Thomson
0d9a39eaf5 win32: drop incorrect constness 2016-02-16 11:50:45 +00:00
Edward Thomson
c4d23928c3 fstat: use our custom stat 2016-02-16 11:50:45 +00:00
Edward Thomson
aadad40592 tree: zap warnings around size_t vs uint16_t 2016-02-16 11:50:44 +00:00
Carlos Martín Nieto
1aa1492182 Merge pull request #3615 from ethomson/rebase_bare
rebase: persist a single in-memory index
2016-02-16 08:54:43 +01:00
Edward Thomson
f28bae0c38 rebase: persist a single in-memory index
When performing an in-memory rebase, keep a single index for the
duration, so that callers have the expected index lifecycle and
do not hold on to an index that is free'd out from under them.
2016-02-15 19:27:06 +00:00
Edward Thomson
35439f5997 win32: introduce p_timeval that isn't stupid
Windows defines `timeval` with `long`, which we cannot
sanely cope with.  Instead, use a custom timeval struct.
2016-02-12 10:34:15 -08:00
Carlos Martín Nieto
5a296ad07e Merge pull request #3610 from ethomson/rebase_bare
rebase: introduce bare rebasing
2016-02-12 00:55:20 +01:00
Edward Thomson
2f2129b1ce Merge pull request #3612 from arthurschreiber/arthur/fix-3173
Horrible fix for #3173.
2016-02-11 15:47:01 -08:00
Arthur Schreiber
3679ebaef5 Horrible fix for #3173. 2016-02-11 23:41:34 +01:00
Carlos Martín Nieto
460ae11f0a commit: don't forget the last header field
When we moved the logic to handle the first one, wrong loop logic was
kept in place which meant we still finished early. But we now notice it
because we're not reading past the last LF we find.

This was not noticed before as the last field in the tested commit was
multi-line which does not trigger the early break.
2016-02-11 22:19:20 +01:00
Carlos Martín Nieto
66ce08a66c Merge pull request #3607 from pks-t/pks/coverity-improvements
Coverity improvements for GITERR_CHECK_ALLOC
2016-02-11 22:16:34 +01:00
Edward Thomson
263e674ec6 merge tests: correct casts 2016-02-11 11:41:23 -08:00
Edward Thomson
ad8aa11288 reset test: fix initialization warning 2016-02-11 11:26:42 -08:00
Edward Thomson
a202e0d45b rebase: allow custom merge_options
Allow callers of rebase to specify custom merge options.  This may
allow custom conflict resolution, or failing fast when conflicts
are detected.
2016-02-11 10:49:25 -08:00
Edward Thomson
ee6673070a rebase: introduce inmemory rebasing
Introduce the ability to rebase in-memory or in a bare repository.

When `rebase_options.inmemory` is specified, the resultant `git_rebase`
session will not be persisted to disk.  Callers may still analyze
the rebase operations, resolve any conflicts against the in-memory
index and create the commits.  Neither `HEAD` nor the working
directory will be updated during this process.
2016-02-11 10:48:48 -08:00
Patrick Steinhardt
50174ab459 coverity: use https URL for posting build
When posting our instrumented build results to Coverity we have
to include sensitive information, in particular our authorization
token. Currently we use an unencrypted channel to post this
information, leading to the token being transferred in plain.

Fix this by using a secured connection instead.
2016-02-10 11:06:23 +01:00
Patrick Steinhardt
8dddea42aa coverity: provide nodef for GITERR_CHECK_ALLOC
Coverity currently lists a lot of errors with regard to
GITERR_CHECK_ALLOC causing resource leaks. We know this macro is
only invoked when we want to abort because we are out of memory.

Coverity allows for overriding the default model where we know
that certain functions guarantee a desired behavior. The
user_nodefs.h is used to override the behavior of macros.
Re-define GITERR_CHECK_ALLOC inside of it to specify its abort
nature.
2016-02-10 10:59:14 +01:00
Edward Thomson
82abd40d80 filter: clean up documentation around custom filters 2016-02-09 21:47:51 -08:00
Edward Thomson
494e61b8a3 win32: drop xp support in WideCharToMultiByte 2016-02-09 21:45:24 -08:00
Edward Thomson
9447b9e55a xplat: use st_mtimespec everywhere on mac 2016-02-09 10:40:33 -08:00