Commit Graph

5401 Commits

Author SHA1 Message Date
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
Carlos Martín Nieto
43e5dda702 config: get rid of a useless asignment 2013-08-12 11:40:57 +02:00
Carlos Martín Nieto
86c0261460 config: deduplicate iterator creation
When the glob iterator is passed NULL regexp, call the non-globbing
iterator so we don't have to special-case which functions to call.
2013-08-12 11:40:57 +02:00
Carlos Martín Nieto
d8289b9fb4 config: handle empty backends when iterating 2013-08-12 11:40:57 +02:00
Carlos Martín Nieto
d8488b981c config: implement _foreach and _foreach_match on top of the iterator directly
Use a glob iterator instead of going through
git_config_backend_foreach_match. This function is left as it's
exposed in the API.
2013-08-12 11:40:57 +02:00
Carlos Martín Nieto
54f3a572b4 config: introduce a regex-filtering iterator 2013-08-12 11:40:57 +02:00
Carlos Martín Nieto
5880962d90 config: introduce _iterator_new()
As the name suggests, it iterates over all the entries
2013-08-12 11:40:57 +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
Carlos Martín Nieto
a319ffaead config: fix leaks in the iterators 2013-08-08 21:00:33 +02:00
Carlos Martín Nieto
1e96c9d534 config: add _next() and _iterator_free()
Make it look like the refs iterator API.
2013-08-08 20:47:06 +02:00
Carlos Martín Nieto
99dfb538ad config: working multivar iterator
Implement the foreach version as a wrapper around the iterator.
2013-08-08 20:38:42 +02:00
Edward Thomson
a1f69452a2 git_strndup fix when OOM 2013-08-08 12:36:11 -05:00
Edward Thomson
57f31f058c Fixes to safely reading the index
Avoid wrapping around extension size when reading, avoid walking off
the end of the buffer when reading names.
2013-08-08 12:32:23 -05:00
Ben Straub
5e96f31638 Merge pull request #1738 from libgit2/diff-patch-content-size
Add API for getting at git_diff_patch->content_size
2013-08-08 08:54:38 -07:00
Ben Straub
bf145a6a2f Merge pull request #1746 from libgit2/rename-detection-performance
Rename detection slow
2013-08-08 08:53:37 -07:00
Ben Straub
aaefbdeea2 Discriminate path-specific and general UTF-X conversions 2013-08-08 08:48:57 -07:00
Carlos Martín Nieto
cca5df6376 config: hopefully get the iterator to work on multivars 2013-08-08 16:59:39 +02:00
Russell Belfer
46c3791115 Merge pull request #1638 from brodie/brodie/handle-duplicate-objects-across-packs
odb_pack: handle duplicate objects from different packs
2013-08-08 07:50:59 -07:00
Carlos Martín Nieto
3a7ffc29c9 config: initial multivar iterator 2013-08-08 16:18:07 +02:00
Carlos Martín Nieto
eba7399251 config: move next() and free() into the iterator
Like we have in the references iterator, next and free belong in the
iterator itself.
2013-08-08 14:39:32 +02:00
Carlos Martín Nieto
4efa32903a config: get_multivar -> get_multivar_foreach
The plain function will return an iterator, so move this one out of
the way.
2013-08-08 13:57:01 +02:00
Carlos Martín Nieto
84fec6f628 config: saner iterator errors
Really report an error in foreach if we fail to allocate the iterator,
and don't fail if the config is emtpy.
2013-08-08 13:14:35 +02:00
Carlos Martín Nieto
82ae6fcdba config: compilation fixes 2013-08-08 11:55:47 +02:00
Carlos Martín Nieto
4d588d9713 Don't typedef a pointer
Make the iterator structure opaque and make sure it compiles.
2013-08-08 11:40:41 +02:00