Romain Geissler
5ec05d0748
Repository: Fixed retrieve_device return type.
2011-06-06 01:26:01 +02:00
Johan 't Hart
393a9f9ee1
Fix build errors on MSVC
2011-06-06 00:33:23 +02:00
Romain Geissler
f11e079733
Index: API uniformisation: Use unsigned int for all index number.
...
Feature Added: Search an unmerged entry by path (git_index_get_unmerged
renamed to git_index_get_unmerged_bypath) or by index (git_index_get_unmerged_byindex).
2011-06-05 21:19:03 +02:00
Romain Geissler
e5c8009731
Tree: API uniformasation: Use unsigned int for all index number.
2011-06-05 21:18:05 +02:00
schu
76b15cb18a
Raise GIT_EEXISTS in case of conflicting ref names instead of passing
...
the error returned by the subsystem; clarify error message.
Fix tiny typo.
Signed-off-by: schu <schu-github@schulog.org>
2011-06-05 20:55:23 +02:00
schu
1b6d8163ce
Teach reference_rename() to really respect other references
...
Add a new function reference_available() to check if a reference name
actually is free and can be used.
Signed-off-by: schu <schu-github@schulog.org>
2011-06-05 19:22:32 +02:00
Romain Geissler
a993e4fe06
Fileops: Fixed gitfo_mkdir_recurs so that it proprely works with a path without trailing slash.
...
It used to discard the last directory if the path didn't have a trailing slash.
2011-06-05 00:20:35 +02:00
Romain Geissler
f2a60854cd
Repository: Fixed the path returned by read_gitfile (remove trailing slashes)
2011-06-05 00:18:34 +02:00
Romain Geissler
8b05e78018
Repository: Fixed a bug in read_gitfile (proprely remove trailings newlines)
2011-06-05 00:17:26 +02:00
Vicent Marti
602ee38b6e
repository: Export all internal paths
2011-06-04 20:45:09 +02:00
Romain Geissler
9d9bab5c38
Repository: Fixed some errors with ceiling_dirs in git_repository_discover.
...
Now the ceiling_dirs are compared with their symbolic free version (like base_path).
The ceiling dirs check is now performed after getting the parent directory.
2011-06-04 16:28:39 +02:00
Vicent Martí
793545ef2b
Merge pull request #227 from Romain-Geissler/discovery-path-v2
...
Discovery path v2
2011-06-03 17:41:53 -07:00
Romain Geissler
fd0574e5ad
Repository: Added the git_repository_discover function that finds by itself the git directory that manage a given directory path.
2011-06-04 01:05:36 +02:00
Romain Geissler
222cf1d459
Repository: Splitted the repository destructor into a helper part (only free directories path) and the complete public destructor.
2011-06-04 00:14:37 +02:00
Romain Geissler
6a01b6bd60
Repository: Added read_gitfile that allows you to read a .git file and extract the git directory path.
2011-06-04 00:10:55 +02:00
Romain Geissler
f2e6b8776e
Repository: Added some util functions that we'll need to discover repository path.
...
retrieve_device returns the file device for a given path (so that we can detect device change while walking through parent directories).
abspath returns a canonicalized path, symbolic link free.
retrieive_ceiling_directories_offset returns the biggest path offset that path match in the ceiling directory list (so that we can stop at ceiling directories).
2011-06-04 00:00:28 +02:00
Romain Geissler
1549cba9a4
Filebuf: Fixed a TODO in filebuf (real lock in lock_file)
...
Added gitfo_creat_locked and gitfo_creat_locked_force
2011-06-03 23:08:42 +02:00
Vicent Marti
3a42e0a370
index: Add git_index_entry_stage
method
...
As suggested by Romain-Geissler
2011-06-03 21:38:55 +02:00
Romain Geissler
bc6484912e
Fileops: Added gitfo_isfile.
...
Conflicts:
src/fileops.c
2011-06-03 21:20:20 +02:00
unknown
26a98ec8a2
Fileops: Added a fourth argument to the path prettifying functions to use an alternate basepath.
...
Fixed a Windows TO-DO in the prettifying functions.
2011-06-03 21:04:02 +02:00
unknown
bb88da7f90
Sha1Lookup: Fixed two MSVC compilation warnings.
2011-06-03 21:03:58 +02:00
Vicent Marti
0291b5b76b
odb: Fix loading ODB alternates
...
Fixed an issue with the `strtokz implementation and added support for
comments and relative paths in the alternates file.
2011-06-03 20:01:18 +02:00
Romain Geissler
04fdc10d35
Fileops:retrieve_path_root_offset is now named gitfo_retrieve_path_root_offset (like other public functions). Added platform specific directory separator definition.
2011-06-03 19:26:45 +02:00
Vicent Martí
1e9b7a09ff
Merge pull request #144 from nordsturm/fix_fakewstream
...
Fix fake wstream write
2011-06-02 15:12:37 -07:00
Vicent Marti
7107b599d7
odb-pack: More variable declarations
2011-06-02 01:03:52 +02:00
Vicent Marti
7b5fe049d1
odb-pack: Do not declare variables mid-function
2011-06-02 00:47:51 +02:00
Vicent Marti
fea400f87b
signature: Fix compilation
2011-06-01 23:41:30 +02:00
Vicent Marti
d0323a5f63
short-oid: Cleanup
2011-06-01 23:40:42 +02:00
Marc Pegon
aea8a638f2
Implemented read_unique_short_oid method for loose backend.
2011-06-01 23:40:42 +02:00
Marc Pegon
6c8ca697be
Fixed some error messages related to searching objects from a short oid. Fixed forgot to check that prefix length is greater than minimum prefix length in read_unique_short_oid method from pack backend.
2011-06-01 23:40:42 +02:00
Marc Pegon
7d74cd44d5
Deleted unused method git_cached_object_match, since we do not explore the cache when searching objects from a short oid.
2011-06-01 23:40:42 +02:00
Marc Pegon
da03c9f35b
Changed return value of git_oid_match to be consistent with the other compare methods (0 means oids match). Added method to compare prefixes of hex formatted oids.
2011-06-01 23:40:42 +02:00
Marc Pegon
ac2b94ad76
Added a GIT_OID_MINPREFIXLEN constant to define the minimum length allowed for oid prefixes (set to 4, like in git). Consequently updated some object lookup methods and their documentation.
2011-06-01 23:40:41 +02:00
Marc Pegon
dd453c4dbf
Added git.git sha1 lookup method to replace simple binary search in pack backend.
...
Implemented find_unique_short_oid for pack backend, based on git sha1 lookup method;
finding an object given its full oid is just a particular case of searching
the unique object matching an oid prefix (short oid).
Added git_odb_read_unique_short_oid, which iterates over all the backends to
find and read the unique object matching the given oid prefix.
Added a git_object_lookup_short_oid method to find the unique object in
the repository matching a given oid prefix : it generalizes git_object_lookup
which now does nothing but calls git_object_lookup_short_oid.
2011-06-01 23:40:41 +02:00
Marc Pegon
53c0bd81a2
Added error for ambiguous oid prefixes. Added methods to compare the first nth hexadecimal characters (i.e. packets of 4 bits) of OIDs.
2011-06-01 23:40:41 +02:00
Marc Pegon
ecd6fdf1f7
Added a read_unique_short_oid method to backends, to make it possible to find objects from sha1 prefixes in the future. Default implementations throw GIT_ENOTIMPLEMENTED for strict prefixes (i.e. length < GIT_OID_HEXSZ).
2011-06-01 23:40:41 +02:00
Vicent Martí
4a51e99814
Merge pull request #224 from glesserd/tagparsing
...
Fix tag and signature parsing
2011-06-01 12:57:47 -07:00
Vicent Martí
dd8a2070ce
Merge pull request #215 from schu/typos
...
Fix typos
2011-06-01 12:54:15 -07:00
Vicent Martí
a7fdce6206
Merge pull request #223 from carlosmn/valgrind
...
Plug a leak in the index unmerged entries vector
2011-06-01 12:53:16 -07:00
Vicent Martí
9db04160a5
Merge pull request #222 from carlosmn/config-bugfix
...
Config bugfix
2011-06-01 12:52:50 -07:00
Vicent Martí
50b7334e51
Merge pull request #206 from nulltoken/topic/is-bare
...
Add git_repository_is_bare() accessor
2011-06-01 09:58:21 -07:00
Vicent Marti
786ad84fa9
index: Cleanup tree parsing
2011-06-01 18:54:56 +02:00
Carlos Martín Nieto
a02fc2cd16
index: correctly parse invalidated TREE extensions
...
A TREE extension with an entry count of -1 means that it was
invalidated and we should ignore it. Do so instead of returning an
error.
This fixes issue #202
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-06-01 18:54:56 +02:00
Carlos Martín Nieto
cdd9fd473e
Allow read_tree_internal to return an error code
...
There are two reasons why read_tree_internal might return a NULL
tree. The first one is a corrupt index, but the second one is an
invalidated TREE extension. Up to now, its only way to communicate
with its caller was through the return value being NULL or not.
Allow read_tree_internal to report its exit status independently from
the tree pointer.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-06-01 18:54:56 +02:00
Vicent Marti
f7e59c4dcf
index: Change the memory management for repo indexes
...
The `git_repository_index` call now returns a brand new index that must
be manually free'd.
2011-06-01 18:54:47 +02:00
David Glesser
fbfc758022
Fix tag and signature parsing
...
Before this commit, malformed tag and signature were considered as
valid by the parser. See the test t3800-mktag.sh of git to see example
of malformed tag and signature.
2011-05-31 18:38:59 +02:00
Carlos Martín Nieto
c7e6e95841
Don't try to parse an empty config file
...
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-05-31 17:57:18 +02:00
Carlos Martín Nieto
5892277cd0
Config parse header ext: don't allow text after closing quote
...
Nothing is allowed betwen the closing quotation mark and the ] so
return an error if there is.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-05-31 17:33:24 +02:00
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
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
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
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
Vicent Marti
5c36f6dbe8
config: Cleanup
2011-05-23 20:43:19 +03:00
Vicent Marti
4c7a5e9e3f
commit: Reword errors
2011-05-23 20:36:06 +03:00
Jakob Pfender
726c6fd293
commit.c: Move to new error handling mechanism
2011-05-23 20:33:41 +03:00
Vicent Marti
adef992232
blob: Reword errors
2011-05-23 20:33:20 +03:00
Jakob Pfender
913691007e
blob.c: Move to new error handling mechanism
2011-05-23 20:31:26 +03:00