Commit Graph

8064 Commits

Author SHA1 Message Date
Edward Thomson
9f73e1f335 Merge pull request #3081 from leoyanggit/build_warnings
Fix some build warnings
2015-05-01 09:01:34 -04:00
Carlos Martín Nieto
5e00e5c965 Merge pull request #3090 from libgit2/jamill/doc_update
Update documentation for API changes
2015-04-30 21:55:10 +02:00
Carlos Martín Nieto
1275de53c5 Merge pull request #3088 from volftomas/patch-1
Fixed unused warning in tests/rebase/merge.c
2015-04-30 21:25:54 +02:00
Jameson Miller
bf2ba5290a Update documentation for API changes 2015-04-30 10:59:50 -04:00
Tomas Paladin Volf
cf2380a623 Fixed unused warning in tests/rebase/merge.c 2015-04-30 14:17:05 +02:00
Carlos Martín Nieto
891cc5045f Merge pull request #3085 from yongthecoder/regfree
Do not call regfree() on an empty regex that is not successfully created...
2015-04-29 22:08:46 +02:00
Yong Li
e30438ccb0 Do not call regfree() on an empty regex that is not successfully created by regcomp
(also removed an unused member "has_regex" from all_iter)
2015-04-29 13:40:42 -04:00
Leo Yang
69f0032b4c Fix some build warnings
In checkout.c and filter.c we were casting a sub struct
to a parent struct which breaks the strict aliasing rules
in C. However we can use .parent or .base to access the
parent struct to avoid the build warnings.

In remote.c the local variable error was not initialized
or updated in some cases. For unintialized error a build
warning will be generated. So always keep error variable
up-to-date.
2015-04-28 12:40:20 -04:00
Edward Thomson
d969d41547 Merge pull request #3071 from linquize/git_reflog_drop
Fix wrong format string in git_reflog_drop() error message
2015-04-24 12:00:51 -04:00
Linquize
31d5dce372 Fix wrong format string in git_reflog_drop() error message 2015-04-24 23:56:59 +08:00
Carlos Martín Nieto
65808406bb Merge pull request #3063 from ethomson/config_validate_name
Validate configuration keys
2015-04-24 02:46:49 +02:00
Edward Thomson
dbb459505c Merge pull request #2997 from libgit2/cmn/secure-transport
Use SecureTransport on OS X
2015-04-23 15:24:05 -04:00
Carlos Martín Nieto
44b769e497 SecureTransport: handle graceful closes
On close, we might get a return code which looks like an error but just
means that the other side closed gracefully. Handle that.
2015-04-23 17:43:44 +02:00
Carlos Martín Nieto
65ac7ddccc SecureTransport: require TLS v1.x
Anything SSL is deprecated. Let's make sure we don't try to use SSL v3
when talking to the server.
2015-04-23 17:43:44 +02:00
Carlos Martín Nieto
85247df084 Update THREADING and CHANGELOG with SecureTransport details 2015-04-23 17:43:44 +02:00
Carlos Martín Nieto
b7e1c81d1b SecureTransport: allow overriding a bad certificate
Do not automatically fail on a bad certificate, but let the caller
decide. This means we don't need our switch on errors anymore but can
return a string representation from the security framework.
2015-04-23 17:43:43 +02:00
Carlos Martín Nieto
24e53d2fba Rename GIT_SSL to GIT_OPENSSL
This is what it's meant all along, but now we actually have multiple
implementations, it's clearer to use the name of the library.
2015-04-23 17:39:51 +02:00
Carlos Martín Nieto
70b852cee2 Silence unused warnings when not using OpenSSL 2015-04-23 17:39:51 +02:00
Carlos Martín Nieto
6946a3be95 Abstract away the TLS stream implementation
Instead, provide git_tls_stream_new() to ask for the most appropriate
encrypted stream and use it in our HTTP transport.
2015-04-23 17:39:51 +02:00
Carlos Martín Nieto
6bb54cbff3 Add a SecureTransport TLS channel
As an alternative to OpenSSL when we're on OS X. This one can actually
take advantage of stacking the streams.
2015-04-23 17:39:51 +02:00
Edward Thomson
d369d71f6a config: peek returns '\n' on EOF; handle in write 2015-04-23 11:25:07 -04:00
Edward Thomson
6dc55872a8 config: ensure we can write to an empty file 2015-04-23 11:25:03 -04:00
Edward Thomson
2c8c00c646 config: validate config keys 2015-04-23 11:24:59 -04:00
Edward Thomson
23fb4004ed config: test that we validate the key 2015-04-23 11:24:50 -04:00
Carlos Martín Nieto
69c333f997 Merge pull request #3064 from rcorre/config-write-fix
config_write -- handle duplicate section headers when deleting entries
2015-04-23 17:23:04 +02:00
Carlos Martín Nieto
63e8b08dfc Merge branch 'attr-ignore' 2015-04-23 17:08:10 +02:00
Mike McQuaid
c02a0e46eb attr_file: fix subdirectory attr case.
Closes #2966.
2015-04-23 17:07:37 +02:00
Mike McQuaid
c6bf03b44f Add failing subdirectory gitignore attr test. 2015-04-23 17:07:37 +02:00
Edward Thomson
27fa7477b0 Merge pull request #3032 from jfultz/index-file-modes
Fix git_checkout_tree() to do index filemodes correctly on Windows.
2015-04-23 10:54:08 -04:00
Carlos Martín Nieto
f564017d96 Merge pull request #3065 from cthomas/master
Fix for Issue #3023 tests fail with no network
2015-04-22 16:16:27 +02:00
cthomas
fc6f044ea3 Fix for Issue #3023 tests fail with no network
Moved offending tests from network to online so they will get skipped
when there is a lack of network connectivity:
-test_online_remotes__single_branch
-test_online_remotes__restricted_refspecs
2015-04-21 20:02:24 -04:00
Edward Thomson
aaf42c8df7 Merge pull request #3051 from jeffhostetler/jeffhostetler/memleak_windows_tls_data
Attempt to fix Windows TLS memory leak.
2015-04-21 18:21:59 -04:00
Ryan Roden-Corrent
9a810c5e33 git_config_delete: search until last section.
If git_config_delete is to work properly in the presence of duplicate section
headers, it cannot stop searching at the end of the first matching section, as
there may be another matching section later.
When config_write is used for deletion (value = NULL), it may only terminate
when the desired key is found or there are no sections left to parse.
2015-04-21 14:24:08 -04:00
Ryan Roden-Corrent
f56a417de4 Specify mock config file content in test.
Instead of using a config file in resources, include the config file content to
be tested directly in the test.
2015-04-21 14:21:52 -04:00
Ryan Roden-Corrent
a060cccc0a Unittest to validate config entry deletion bug.
Add a unittest to validate bug #3043, where a duplicate empty config header
could cause deletion of a config entry to fail silently. The bug is currently
unresolved and this test will fail.
2015-04-21 14:21:52 -04:00
Carlos Martín Nieto
7636f740b3 Merge pull request #2992 from ethomson/rebase_fixes
Rebase fixes
2015-04-21 14:38:23 +02:00
Carlos Martín Nieto
3a63e8c299 Merge pull request #3060 from ethomson/2851
Handle invalid multiline configuration
2015-04-21 14:04:45 +02:00
John Fultz
d3282680ed Fix index-adding functions to know when to trust filemodes.
The idea...sometimes, a filemode is user-specified via an
explicit git_index_entry.  In this case, believe the user, always.

Sometimes, it is instead built up by statting the file system.  In
those cases, go with the existing logic we have to determine
whether the file system supports all filemodes and symlinks, and
make the best guess.

On file systems which have full filemode and symlink support, this
commit should make no difference.  On others (most notably Windows),
this will fix problems things like:
* git_index_add and git_index_add_frombuffer() should be believed.
* As a consequence, git_checkout_tree should make the filemodes in
the index match the ones in the tree.
* And diffs with GIT_DIFF_UPDATE_INDEX don't write the wrong filemodes.
* And merges, and probably other downstream stuff now fixed, too.

This makes my previous changes to checkout.c unnecessary,
so they are now reverted.

Also, added a test for index_entry permissions from git_index_add
and git_index_add_frombuffer, both of which failed before these changes.
2015-04-21 02:17:23 -05:00
Edward Thomson
aa9bb425a9 rebase: correct documentation, CHANGELOG 2015-04-20 17:22:39 -04:00
Edward Thomson
94c988f6d6 rebase: include checkout opts within rebase opts 2015-04-20 17:19:08 -04:00
Edward Thomson
7838235890 rebase: test checkout options for rebase 2015-04-20 16:22:59 -04:00
Edward Thomson
f3a199dd99 rebase: init and open take a rebase_options
`git_rebase_init` and `git_rebase_open` should take a
`git_rebase_options` and use it for future rebase operations on
that `rebase` object.
2015-04-20 16:22:54 -04:00
Edward Thomson
5ae38538c6 rebase: take checkout_options where appropriate 2015-04-20 16:22:49 -04:00
Edward Thomson
649834fd6e reset: git_checkout_options is const 2015-04-20 16:22:44 -04:00
Edward Thomson
eaf0d68830 rebase: block rebase_commit with unstaged changes 2015-04-20 16:22:39 -04:00
Edward Thomson
49b3ddf216 rebase: commit should return GIT_EUNMERGED
git_rebase_commit should return `GIT_EUNMERGED` when unmerged items
exist in the index, per the documentation.  Test that this is correct.
2015-04-20 16:22:31 -04:00
Edward Thomson
30640aa9ad rebase: identify a rebase that has not started
In `git_rebase_operation_current()`, indicate when a rebase has not
started (with `GIT_REBASE_NO_OPERATION`) rather than conflating that
with the first operation being in-progress.
2015-04-20 16:22:27 -04:00
Edward Thomson
e009a7059d config_file: comment char can be invalid escape
Don't assume that comment chars are comment chars, they may be (an
attempt to be escaped).  If so, \; is not a valid escape sequence,
complain.
2015-04-20 00:26:00 -04:00
Edward Thomson
7f2e61f3ee config_file: parse multilines generously
Combine unquoting and multiline detection to avoid ambiguity when
parsing.
2015-04-20 00:25:44 -04:00
Edward Thomson
08c45213b1 Merge pull request #3024 from git-up/diff_merge_fix
Make sure to also update delta->nfiles when merging diffs
2015-04-19 19:58:03 -04:00