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
Nico von Geyso
a603c19157
replaced foreach() with non callback based iterations in git_config_backend
...
new functions in struct git_config_backend:
* iterator_new(...)
* iterator_free(...)
* next(...)
The old callback based foreach style can still be used with `git_config_backend_foreach_match`
2013-08-08 11:14:53 +02:00
Nico von Geyso
6385fc5ff5
added new type and several functions to git_strmap
...
This step is needed to easily add iterators to git_config_backend
As well use these new git_strmap functions to implement foreach
* git_strmap_iter
* git_strmap_has_data(...)
* git_strmap_begin(...)
* git_strmap_end(...)
* git_strmap_next(...)
2013-08-08 11:07:03 +02:00
Brodie Rao
d19bcb3352
odb_pack: handle duplicate objects from different packs
...
This is based on 24634c6fd0
.
This also corrects an issue with error codes being mixed up with the
number of found objects.
2013-08-08 00:41:16 -07:00
Ben Straub
2c0128ee79
Rename git_win_str_utf* to git_win32_path_utf*
2013-08-07 19:29:33 -07:00
Ben Straub
9c38f7a652
Add typedefs for win32 utf-8 and utf-16 buffers
...
...and normalize the signatures of the two conversion functions.
2013-08-07 13:22:41 -07:00
Ben Straub
75f98a95ee
Add checkout test for long file name
2013-08-07 11:55:47 -07:00
Ben Straub
c0c5169352
Add long-file-name branch to test repo
2013-08-07 11:55:39 -07:00
Ben Straub
2984f3190e
Don't use win32-only macro in test code
2013-08-07 11:47:56 -07:00
Ben Straub
8c8a549010
Add status test for long paths
2013-08-07 11:47:56 -07:00
Russell Belfer
c7d4904c47
Merge pull request #1769 from ethomson/configparse
...
Parse config headers with quoted quotes
2013-08-07 10:38:41 -07:00
Edward Thomson
2d9f5b9f13
Parse config headers with quoted quotes
...
Parse config headers that have the last quote on the
line quoted instead of walking off the end.
2013-08-07 12:38:09 -05:00
Russell Belfer
c5780abb02
Merge pull request #1765 from arrbee/ambiguous-oids
...
More tests for ambiguous OIDs across packs
2013-08-05 21:58:48 -07:00
Russell Belfer
437224b4b9
More tests for ambiguous OIDs across packs
...
The test coverage for ambiguous OIDs was pretty thin. This adds
a bunch of new objects both in packs, across packs, and loose that
match to 8 characters so that we can test various cases of
ambiguous lookups.
2013-08-05 21:46:32 -07:00
Russell Belfer
ee77378d9b
Merge pull request #1763 from nvloff/nameless_submodule_segfault
...
submodule: check alloc and name presence
2013-08-05 13:33:44 -07:00