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
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
Carlos Martín Nieto
cca5df6376
config: hopefully get the iterator to work on multivars
2013-08-08 16:59:39 +02: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
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
Nikolai Vladimirov
f1af935b89
submodule: check alloc and name presense
2013-08-05 22:00:55 +03:00
Russell Belfer
9b7d02ff2d
Update submodule documentation
...
Fixes #1762
2013-08-05 10:53:39 -07:00
Carlos Martín Nieto
1cd0acf672
Merge pull request #1748 from arthurschreiber/patch-1
...
Allow Makefile.embed to be used when cross-compiling
2013-07-31 10:43:56 -07:00
Arthur Schreiber
a6837b5fc9
When building with MINGW, specify __USE_MINGW_ANSI_STDIO
.
...
This option is already present in the CMake config, but was missing from `Makefile.embed` and would cause all kinds of weird failures when compiling rugged on windows with the ruby devkit.
2013-07-31 19:13:35 +02:00
Ben Straub
94d12ffab7
Merge pull request #1755 from csware/double-close
...
Fix possible double close
2013-07-28 08:39:41 -07:00
Vicent Martí
a873449f1c
Merge pull request #1753 from 13ren/log-bugfix
...
Fix -n bug; default to all ancestors
2013-07-27 17:00:21 -07:00
Sven Strickroth
f5254d7844
Fix possible double close
...
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2013-07-27 20:15:06 +02:00
Brendan Macmillan
c3ae047361
Fix -n bug; default to all ancestors
2013-07-27 05:34:49 +10:00
Vicent Martí
d477a9ab7e
Merge pull request #1749 from csware/handle-fixes
...
Close p->mwf.fd only if necessary
2013-07-25 06:44:56 -07:00
Sven Strickroth
3a2d48d5ee
Close p->mwf.fd only if necessary
...
This fixes a regression introduced in revision 9d2f841a5d
.
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2013-07-25 15:21:55 +02:00
Arthur Schreiber
847c679309
Allow Makefile.embed to be used when cross-compiling
...
This allows libgit2 to be cross-compiled (e.g. when building native rugged binaries for windows from Linux or OS X).
```
CROSS_COMPILE=i686-w64-mingw32 make -f Makefile.embed
```
2013-07-25 00:26:51 +02:00
Russell Belfer
cdbcb8dd80
Merge pull request #1745 from libgit2/doc-fixes
...
Doc fixes
2013-07-23 09:43:07 -07:00
Carlos Martín Nieto
64061d4a14
remote: fix git_remote_download() documentation
...
The description of what the function does hasn't been true for quite a
while. Change it to reflect the way it currently works.
While here, remove an even older comment about missing features that
have been implemented.
2013-07-23 10:51:14 +02:00
Carlos Martín Nieto
c05a55b056
Clean up some documentation
...
clang's docparser highlighted these.
2013-07-23 09:40:19 +02:00
Vicent Martí
e5bdf82976
Merge pull request #1732 from libgit2/revwalk-glob-should-ignore-invalid
...
Invalid refs on disk cause revwalk globbing to fail
2013-07-22 23:59:08 -07:00
Russell Belfer
4cee9b8618
Update init and clean for revwalk::basic tests
...
The new tests don't always want to use the same fixture data as
the old ones so this makes it configurable on a per-test basis.
2013-07-22 11:41:23 -07:00
Russell Belfer
989710d982
Fix warning message about mismatched types
2013-07-22 11:22:55 -07:00
Russell Belfer
c77342ef1c
Use pool for loose refdb string allocations
...
Instead of using lots of strdup calls, this adds a memory pool to
the loose refs iteration code and uses it for keeping track of the
loose refs array. Memory usage could probably be reduced even
further by eliminating the vector and just scanning by adding the
strlen of each ref, but that would be a more intrusive changes.
This also updates the error handling to be more thorough about
checking for failed allocations, etc.
2013-07-22 11:20:34 -07:00
Russell Belfer
b71071313f
git_reference_next_name must match git_reference_next
...
The git_reference_next API silently skips invalid references when
scanning the loose refs. The git_reference_next_name API should
skip the same ones even though it isn't creating the reference
object.
This adds a test with a an invalid loose reference and makes sure
that both APIs skip the same entries and generate the same results.
2013-07-22 11:01:19 -07:00
Martin Woodward
1cd9dc29b7
Merge pull request #1743 from ethomson/readme
...
Clarify when to use github issues
2013-07-19 11:14:22 -07:00
Edward Thomson
bef59b1be4
Update README.md
2013-07-19 12:56:47 -05:00
Ben Straub
97309dd025
Merge pull request #1726 from crazymaster/development
...
git_buf_text_gather_stats doesn't work for multi-byte characters
2013-07-19 10:43:53 -07:00
Edward Thomson
41a93cc6e5
Clarify when to use github issues
...
Suggest that github issues are to be used for bug reports, while questions about usage should be directed to StackOverflow.
2013-07-19 12:43:08 -05:00
Ben Straub
847b8e0e44
Merge pull request #1742 from martinwoodward/Refresh-Readme
...
Refresh readme and contributing guidance
2013-07-19 10:29:47 -07:00
Martin Woodward
6ca83665c7
Update contributing guidance to explain PR flow
...
Updating the contributing guidance to explain a bit more about how we use
PR's
2013-07-19 18:20:58 +01:00
Martin Woodward
3e3d332b4c
Tidy up the methods of contacting the project
...
Updated the methods of getting involved with the project and asking
questions.
2013-07-19 18:04:11 +01:00
Ben Straub
275d8d55b2
Typo
2013-07-18 09:37:59 -07:00
Vicent Martí
794003650e
Merge pull request #1736 from ben/default-to-cdecl
...
Switch default calling convention to cdecl
2013-07-18 06:26:25 -07:00
Ben Straub
99a9c86cb6
Merge pull request #1722 from libgit2/ntk/fix/issue_1722
...
git_revparse_ext: should return a NULL reference when the revparse expression doesn't lead to a reference
2013-07-17 20:08:15 -07:00