Commit Graph

5254 Commits

Author SHA1 Message Date
Russell Belfer
ce23330fd6 Add new git_signature_default API using config
This adds a new API for creating a signature that uses the
config to look up "user.name" and "user.email".
2013-08-16 15:04:15 -07:00
Ben Straub
68458e422a Merge pull request #1789 from martinwoodward/posix_win32-attribution
Give credit to PHP for the p_readlink function in posix_w32.c
2013-08-16 13:25:18 -07:00
Martin Woodward
c9340df055 Give credit to PHP for the p_readlink function in posix_w32.c 2013-08-16 19:40:58 +01:00
Vicent Martí
4424622328 Merge pull request #1784 from evhan/development
revparse: Free left side of invalid range revspecs
2013-08-14 23:15:02 -07:00
Evan Hanson
1616fa68e5 revparse: Use more idiomatic error value test 2013-08-15 17:25:05 +12:00
Evan Hanson
899ec41fa1 revparse: Free left side of invalid range revspecs
This fixes a small memory leak in git_revparse where early returns on
errors from git_revparse_single cause a free() on the (reallocated) left
side of the revspec to be skipped.
2013-08-15 16:25:48 +12:00
Vicent Marti
1e94df08da sha1-lookup: This assert was correct 2013-08-15 00:09:46 +02:00
Russell Belfer
c87bf86cd7 Commit 7affc2f7 removed var initialization
That commit accidentally removed the initialization of the "start"
variable giving undefined results for the host extraction from the
url input.
2013-08-14 10:58:02 -07:00
Vicent Martí
ad0af71575 Merge pull request #1780 from phkelley/development
Respect GIT_SSL_NO_VERIFY and http.sslVerify
2013-08-14 06:48:09 -07:00
Vicent Martí
9d1751bf6e Merge pull request #1783 from libgit2/cmn/relax-remote
remote: relax the url rules
2013-08-14 06:44:28 -07:00
Vicent Martí
c4ded21e83 Merge pull request #1774 from libgit2/test-ssh
Test SSH in travis
2013-08-14 06:43:43 -07:00
Vicent Martí
89f6d84ccf Merge pull request #1781 from brodie/brodie/stat-before-open
fileops: stat() before open()ing in git_futils_readbuffer_updated()
2013-08-14 06:40:38 -07:00
Vicent Martí
d5904eb865 Merge pull request #1782 from libgit2/vmg/no-lookup
Do not use the "experimental" lookup mode
2013-08-14 06:38:37 -07:00
Carlos Martín Nieto
0b9ebb54ff remote: relax the url rules
Accept any value for the remote's url, including an empty string which
we used to reject as invalid configuration.

This is not quite what git does (although it has its own problems with
such configurations) and it makes it harder to fix the issue, by not
letting the user modify it.

As we already need to check for a valid URL when we try to connect to
the network, let that perform the check, as we don't need to do it
anywhere else.
2013-08-14 11:52:49 +02:00
Carlos Martín Nieto
5be622fb56 Test SSH in travis
Set up the ssh credentials so we are able to talk to localhost and
issue git commands. Move to use a script, as the command list is
getting somewhat long.

While here, delay installing valgrind until we need it, as it and its
dependencies are by far the largest downloads and this allows us to
start compiling (and failing) faster and we only incur this cost when
the test suite runs successfully.
2013-08-14 10:49:10 +02:00
Vicent Marti
59547ce772 oid: Helper for old-school hashcmp 2013-08-14 10:34:07 +02:00
Vicent Marti
e2164da5eb sha1_lookup: Hello my name is MSVC and how do I pointer 2013-08-14 10:31:02 +02:00
Vicent Marti
67591c8cd8 sha1_lookup: do not use the "experimental" lookup mode 2013-08-14 10:28:01 +02:00
Philip Kelley
af6dab7ef7 Respect GIT_SSL_NO_VERIFY and http.sslVerify 2013-08-13 15:10:03 -04:00
Ben Straub
2af9bcb2db Merge pull request #1779 from ben/win32-precompiled-header-speedup
Speed up build under MSVC
2013-08-13 11:37:31 -07:00
Vicent Martí
40948998ba Merge pull request #1767 from libgit2/win32-bigger-utf8-buffer
Bigger buffer for utf-8 parsing in win32
2013-08-13 11:36:24 -07:00
Brodie Rao
9ccdb21155 fileops: stat() before open()ing in git_futils_readbuffer_updated()
This reverts refactoring done in 13224ea4aa
that introduces a performance regression for NFS when reading files that
don't exist. open() forces a cache invalidation on NFS, while stat()ing a
file just uses the cache and is very quick.

To give a specific example, say you have a repo with a thousand packed
refs. Before this change, looking up every single one ould incur a thousand
slow open() calls. With this change, it's a thousand fast stat() calls.
2013-08-13 10:55:37 -07:00
Russell Belfer
0228a51429 Missed one path for path_as_utf8 type 2013-08-13 10:20:25 -07:00
Russell Belfer
ee0656012c Minor win32 fixes and improvements
This is just a bunch of small fixes that I noticed while looking
at the UTF8 and UTF16 path stuff.  It fixes a slowdown in looking
for an empty directory (not exiting loop asap), makes the dir name
in the git__DIR structure be a GIT_FLEX_ARRAY to save an allocation,
and fixes some slightly odd assumptions in the cl_getenv helper.
2013-08-13 09:53:56 -07:00
Russell Belfer
841034a35e Reintroduce type for UTF8 win32 path conversions 2013-08-13 09:45:56 -07:00
Russell Belfer
d4cff0cb1c Rename git__win32_path fns to git_win32_path 2013-08-13 09:40:32 -07:00
Ben Straub
e12618b1ec Add some things to precompiled header 2013-08-13 09:22:53 -07:00
Ben Straub
3869a171dd Fix mingw cross-compile build 2013-08-13 09:10:34 -07:00
Vicent Marti
3948e86240 windows: Fuck me 2013-08-13 09:38:37 +02:00
Vicent Marti
345b6307be windows: Require order 2013-08-13 09:35:07 +02:00
Vicent Marti
53d712dcb9 windows: Missing renames. 2013-08-13 09:31:03 +02:00
Vicent Marti
abf3732728 windows: Path conversion with better semantics 2013-08-13 09:15:39 +02:00
Ben Straub
14da618260 Merge pull request #1775 from libgit2/ssh-default-user
SSH username fixes
2013-08-12 12:05:58 -07:00
Ben Straub
423e3b0c48 Update to clar 7bf638b80 2013-08-12 11:02:53 -07:00
Carlos Martín Nieto
d10de8bd8d CMake: finding libssh2 should be idempotent
With the current code, running 'cmake .' in an already-configured
directory causes the removal of ssh flags passed to the compiler,
making it impossible to build with ssh support but by removing CMake's
cache.

Remove the check for LIBSSH2_LIBRARY and let CMake do the right thing
wrt finding the library.
2013-08-12 12:07:33 +02:00
Carlos Martín Nieto
7affc2f7de Include username in each credential type
Key-based authentication also needs an username, so include it in each
one.

Also stop assuming a default username of "git" in the ssh transport
which has no business making such a decision.
2013-08-12 12:07:21 +02:00
Carlos Martín Nieto
e54cfb9b54 odb: free object data when id is ambiguous
By the time we recognise this as an ambiguous id, the object's data
has been loaded into memory. Free it when returning EABMIGUOUS.
2013-08-12 11:50:27 +02:00
Ben Straub
8ca093991d Merge pull request #1768 from arrbee/issue-1766-gitignore-weirdness
Fix issue 1766 - bugs in managing ignore file lists
2013-08-11 17:28:33 -07:00
Ben Straub
0e26fca1da Make utf-8 source strings unlimited 2013-08-10 15:11:19 -07:00
Ben Straub
aa0af72933 Fix 64-bit MSVC warnings 2013-08-10 14:56:58 -07:00
Vicent Martí
a25519acc1 Merge pull request #1770 from ethomson/index_fuzz
Fixes to safely reading the index
2013-08-09 15:30:50 -07:00
Russell Belfer
3bc3ed80f4 Improve and comment git_ignore__pop_dir
This just cleans up the improved logic for popping ignore dirs
and documents why the complex behavior is needed.
2013-08-09 11:41:41 -07:00
Russell Belfer
ba8b8c0407 Improve building ignore file lists
The routines to push and pop ignore files while traversing a
directory had some issues. In particular, setting up the initial
list would sometimes push an ignore file before it ought to be
applied if the starting path was a directory containing an ignore
file. Also, the pop function was not always matching the right
part of the path and would fail to pop ignores from the list in
some cases.

This adds some tests that exercise a particular problematic case
and then fixes the problems that I could find related to this.

At some point, I'd like to isolate this ignore rule management
code and rewrite it, but that's a larger project and right now,
I'll opt to just try to fix the broken behaviors.
2013-08-09 11:41:41 -07:00
Russell Belfer
d1be9e4ca1 Merge pull request #1773 from arrbee/fix-fnmatch-prefix
Revert PR #1462 and provide alternative fix
2013-08-09 11:39:38 -07:00
Russell Belfer
b7b77def93 Match against file with leading ! was too broad 2013-08-09 11:20:49 -07:00
Russell Belfer
4ba64794ae Revert PR #1462 and provide alternative fix
This rolls back the changes to fnmatch parsing from commit
2e40a60e84 except for the tests
that were added.  Instead this adds couple of new flags that can
be passed in when attempting to parse an fnmatch pattern.  Also,
this changes the pathspec match logic to special case matching a
filename with a '!' prefix against a negative pattern.

This fixes the build.
2013-08-09 10:52:35 -07:00
Russell Belfer
fbb6c0c84c Merge pull request #1764 from ethomson/status_renames_from_rewrites
Add rename from rewrites to status
2013-08-09 09:35:23 -07:00
Russell Belfer
33d532dcfa Merge pull request #1462 from yorah/fix/libgit2sharp-issue-379
status: fix handling of filenames with special prefixes
2013-08-09 09:32:06 -07:00
Russell Belfer
7f7ebe13c4 Merge pull request #1771 from nvloff/write_empty_config_value
config: allow setting  empty string as value
2013-08-08 12:57:13 -07:00
Nikolai Vladimirov
c57f668268 config: allow empty string as value
`git_config_set_string(config, "config.section", "")` fails when
escaping the value.

The buffer in `escape_value` is allocated without NULL-termination. And
in case of empty string 0 is passed for buffer size in `git_buf_grow`.

`git_buf_detach` returns NULL when the allocated size is 0 and that
leads to an error return in `GITERR_CHECK_ALLOC` called after
`escape_value`

The change in `config_file.c` was suggested by Russell Belfer <rb@github.com>
2013-08-08 22:25:25 +03:00