Commit Graph

1136 Commits

Author SHA1 Message Date
Carlos Martín Nieto
7288d8b65c Parse section header ext: don't leak on error
Also free the subsection if we find too many quotes

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-05-31 17:33:24 +02:00
Carlos Martín Nieto
7bc9e2aa2f Guard against double-freeing the current section
If parse_section_header{,_ext} return an error, current_section
doesn't get allocated. Set it to NULL after freeing so we don't try to
free it again.

This fixes part 2-2 of Issue #210.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-05-31 17:33:23 +02:00
Carlos Martín Nieto
f2abee47d8 cfg_readline: really ignore empty lines
Simplify cfg_readline and at the same time fix it so that it does
really ignore empty lines.

This fixes point 2-1 of Issue #210

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-05-31 17:33:23 +02:00
Carlos Martín Nieto
a5f43b9536 Config file open: don't free memory that doesn't belong to us
On error, it would free the configuration object even though it didn't
own that memory, which would cause a double-free.

This fixes the first part of Issue #210

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-05-31 17:33:23 +02:00
Carlos Martín Nieto
71da57aefd Plug a leak in the index unmerged entries vector
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-05-31 16:49:15 +02:00
David Glesser
ac4fcf173d Modify git_tag_create_frombuffer: the buffer is not modified when
writen to the odb

libgit2 has now the same behaviour of git when adding a tag with a
buffer.
2011-05-31 16:31:12 +02:00
David Glesser
3ecdf91065 Modify create_tag : verifications are now done in an another function
This commit create a function called tag_valid_in_odb which validate a
tag before its creation. This function will be needed by my next commit.
2011-05-31 11:53:09 +02:00
schu
a7ed162538 test_lib.c: flush stdout after every test-run
Make sure the user immediately sees the feedback, '.' or 'F', for a
test. If it's only in the buffer, it may gets "lost" in case of error.

Signed-off-by: schu <schu-github@schulog.org>
2011-05-30 21:13:11 +02:00
David Glesser
23123151e0 Set the oid when a tag already exists.
When a tag already exists, it can be useful to directly have the oid
of the existed tag, just after trying to add it.
2011-05-30 09:03:55 +02:00
David Glesser
448c4d012b Add an error message when a tag already exists.
Before this commit, no message is shown when doing a git_lasterror().
2011-05-30 08:46:48 +02:00
schu
286349c6ec Fix tiny typo
Signed-off-by: nulltoken <emeric.fermas@gmail.com>
Signed-off-by: schu <schu-github@schulog.org>
2011-05-29 20:15:27 +02:00
schu
f5a86fefa9 gitfo_isdir: fix error message
Signed-off-by: schu <schu-github@schulog.org>
2011-05-29 17:44:14 +02:00
nulltoken
fa9bcd81f5 Add git_repository_is_bare() accessor 2011-05-24 21:50:02 +02:00
Vicent Martí
4191d52924 Merge pull request #204 from nulltoken/fix/build-msvc
Fix compilation warnings in MSVC
2011-05-24 10:02:33 -07:00
nulltoken
3a1c431011 Fix compilation warnings in MSVC
This allows to successfully build libgit2 with waf on Windows.
2011-05-24 18:55:35 +02:00
Vicent Marti
8146fe7cb9 index: Fix unused error messages 2011-05-23 21:41:13 +03:00
Jakob Pfender
d320c52d3b index.c: Move to new error handling mechanism 2011-05-23 21:39:56 +03:00
Jakob Pfender
ec9edd5657 config_file.c: Move to new error handling mechanism 2011-05-23 21:38:44 +03:00
Jakob Pfender
a6d647d258 win32/pthread.c: Move to new error handling mechanism 2011-05-23 21:38:43 +03:00
Jakob Pfender
7c8b597ec3 win32/map.c: Move to new error handling mechanism 2011-05-23 21:38:42 +03:00
Jakob Pfender
450ac186f9 unix/map.c: Move to new error handling mechanism 2011-05-23 21:38:41 +03:00
Jakob Pfender
57435a6dff backends/sqlite.c: Move to new error handling mechanism 2011-05-23 21:38:41 +03:00
Jakob Pfender
43a0bc01ce backends/hiredis.c: Move to new error handling mechanism 2011-05-23 21:38:40 +03:00
Jakob Pfender
33b1d19e76 util.c: Move to new error handling mechanism 2011-05-23 21:38:39 +03:00
Jakob Pfender
bc06a4eeec tree.c: Move to new error handling mechanism 2011-05-23 21:38:39 +03:00
Jakob Pfender
6e34ee61bc tag.c: Move to new error handling mechanism 2011-05-23 21:38:38 +03:00
Jakob Pfender
005564967f signature.c: Move to new error handling mechanism 2011-05-23 21:38:37 +03:00
Jakob Pfender
c0cd9d506b revwalk.c: Move to new error handling mechanism 2011-05-23 21:38:35 +03:00
Jakob Pfender
4f664a1b3d repository.c: Move to new error handling mechanism 2011-05-23 21:38:19 +03:00
Vicent Marti
0d5d5190f2 refs: Reword errors 2011-05-23 21:37:48 +03:00
Jakob Pfender
5bdf7b9f54 refs.c: Move to new error handling mechanism 2011-05-23 21:15:35 +03:00
Jakob Pfender
bea548420b oid.c: Move to new error handling mechanism 2011-05-23 21:15:26 +03:00
Vicent Marti
f84d981938 odb_pack: Reword errors 2011-05-23 21:14:58 +03:00
Jakob Pfender
267d539f4a odb_pack.c: Move to new error handling mechanism 2011-05-23 21:12:28 +03:00
Vicent Marti
60e1b49abd odb_loose: Reword errors 2011-05-23 21:12:18 +03:00
Jakob Pfender
dfb12cd544 odb_loose.c: Move to new error handling mechanism 2011-05-23 21:09:33 +03:00
Jakob Pfender
f93f8ec5d0 odb_loose.c: Return GIT_ENOMEM when allocation fails
When trying to inflate a buffer, a GIT_ERROR was returned when malloc()
failed.

Fix this to return GIT_ENOMEM.
2011-05-23 21:09:21 +03:00
Vicent Marti
1e85d1aa03 odb: Reword errors 2011-05-23 21:09:07 +03:00
Jakob Pfender
d3d5d86d4d odb.c: Move to new error handling mechanism 2011-05-23 21:05:58 +03:00
Vicent Marti
6623f5c91b object: Reword errors 2011-05-23 21:05:43 +03:00
Jakob Pfender
75eb97fed0 object.c: Move to new error handling mechanism 2011-05-23 21:04:19 +03:00
Vicent Marti
0be7f000a5 hashtable: Reword errors 2011-05-23 21:04:09 +03:00
Jakob Pfender
da533495c5 hashtable.c: Move to new error handling mechanism 2011-05-23 21:03:18 +03:00
Vicent Marti
d3ca89fe60 fileops: Cleanup 2011-05-23 21:03:01 +03:00
Jakob Pfender
cc2ac058b3 fileops.c: Move to new error handling mechanism 2011-05-23 21:00:40 +03:00
Vicent Marti
f6328611dc filebuf: Reword errors 2011-05-23 21:00:19 +03:00
Jakob Pfender
374db5f912 filebuf.c: Move to new error handling mechanism 2011-05-23 20:45:19 +03:00
Jakob Pfender
68384a27e5 config.c: Fix format string error 2011-05-23 20:45:13 +03:00
Jakob Pfender
4152a44bd8 delta-apply.c: Move to new error handling mechanism 2011-05-23 20:44:10 +03:00
Jakob Pfender
21dcb75abd delta-apply.c: Use GIT_ENOMEM instead of GIT_ERROR when allocating
git__delta_apply used to return with a generic GIT_ERROR when allocating
memory for the delta failed.

Fix this to return GIT_ENOMEM.
2011-05-23 20:43:58 +03:00