]>
git.proxmox.com Git - libgit2.git/log
Romain Geissler [Sat, 4 Jun 2011 22:23:24 +0000 (00:23 +0200)]
Tests: Added tests for git_repository_discover.
Unfortunately, the across_fs flag can't be tested automaticly, as we can't
create a temporary new filesystem.
Romain Geissler [Sat, 4 Jun 2011 22:20:35 +0000 (00:20 +0200)]
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.
Romain Geissler [Sat, 4 Jun 2011 22:18:34 +0000 (00:18 +0200)]
Repository: Fixed the path returned by read_gitfile (remove trailing slashes)
Romain Geissler [Sat, 4 Jun 2011 22:17:26 +0000 (00:17 +0200)]
Repository: Fixed a bug in read_gitfile (proprely remove trailings newlines)
Romain Geissler [Sat, 4 Jun 2011 14:28:39 +0000 (16:28 +0200)]
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.
Romain Geissler [Fri, 3 Jun 2011 23:01:20 +0000 (01:01 +0200)]
Repository: Added the git_repository_discover function that finds by itself the git directory that manage a given directory path.
Romain Geissler [Fri, 3 Jun 2011 22:14:37 +0000 (00:14 +0200)]
Repository: Splitted the repository destructor into a helper part (only free directories path) and the complete public destructor.
Romain Geissler [Fri, 3 Jun 2011 22:10:55 +0000 (00:10 +0200)]
Repository: Added read_gitfile that allows you to read a .git file and extract the git directory path.
Romain Geissler [Fri, 3 Jun 2011 21:44:38 +0000 (23:44 +0200)]
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).
Romain Geissler [Fri, 3 Jun 2011 19:18:24 +0000 (21:18 +0200)]
Filebuf: Fixed a TODO in filebuf (real lock in lock_file)
Added gitfo_creat_locked and gitfo_creat_locked_force
Romain Geissler [Fri, 3 Jun 2011 19:09:14 +0000 (21:09 +0200)]
Fileops: Added gitfo_isfile.
Conflicts:
src/fileops.c
unknown [Fri, 3 Jun 2011 18:47:56 +0000 (20:47 +0200)]
Fileops: Added a fourth argument to the path prettifying functions to use an alternate basepath.
Fixed a Windows TO-DO in the prettifying functions.
unknown [Fri, 3 Jun 2011 17:38:46 +0000 (19:38 +0200)]
Sha1Lookup: Fixed two MSVC compilation warnings.
Romain Geissler [Fri, 3 Jun 2011 17:26:45 +0000 (19:26 +0200)]
Fileops:retrieve_path_root_offset is now named gitfo_retrieve_path_root_offset (like other public functions). Added platform specific directory separator definition.
Vicent Martí [Thu, 2 Jun 2011 22:12:37 +0000 (15:12 -0700)]
Merge pull request #144 from nordsturm/fix_fakewstream
Fix fake wstream write
Vicent Marti [Wed, 1 Jun 2011 23:03:52 +0000 (01:03 +0200)]
odb-pack: More variable declarations
Vicent Marti [Wed, 1 Jun 2011 22:47:51 +0000 (00:47 +0200)]
odb-pack: Do not declare variables mid-function
Vicent Marti [Wed, 1 Jun 2011 21:41:30 +0000 (23:41 +0200)]
signature: Fix compilation
Vicent Marti [Wed, 1 Jun 2011 19:25:56 +0000 (21:25 +0200)]
short-oid: Cleanup
Marc Pegon [Sun, 29 May 2011 16:00:35 +0000 (18:00 +0200)]
Implemented read_unique_short_oid method for loose backend.
Marc Pegon [Sun, 29 May 2011 15:57:25 +0000 (17:57 +0200)]
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.
Marc Pegon [Sun, 29 May 2011 09:46:42 +0000 (11:46 +0200)]
Deleted unused method git_cached_object_match, since we do not explore the cache when searching objects from a short oid.
Marc Pegon [Sun, 29 May 2011 09:45:34 +0000 (11:45 +0200)]
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.
Marc Pegon [Sat, 28 May 2011 19:24:25 +0000 (21:24 +0200)]
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.
Marc Pegon [Fri, 27 May 2011 20:46:41 +0000 (22:46 +0200)]
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.
Marc Pegon [Fri, 27 May 2011 20:37:10 +0000 (22:37 +0200)]
Added error for ambiguous oid prefixes. Added methods to compare the first nth hexadecimal characters (i.e. packets of 4 bits) of OIDs.
Marc Pegon [Fri, 27 May 2011 16:49:09 +0000 (18:49 +0200)]
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).
Vicent Martí [Wed, 1 Jun 2011 19:57:47 +0000 (12:57 -0700)]
Merge pull request #224 from glesserd/tagparsing
Fix tag and signature parsing
Vicent Martí [Wed, 1 Jun 2011 19:54:15 +0000 (12:54 -0700)]
Merge pull request #215 from schu/typos
Fix typos
Vicent Martí [Wed, 1 Jun 2011 19:53:46 +0000 (12:53 -0700)]
Merge pull request #218 from schu/tests-fflush
test_lib.c: flush stdout after every test-run
Vicent Martí [Wed, 1 Jun 2011 19:53:16 +0000 (12:53 -0700)]
Merge pull request #223 from carlosmn/valgrind
Plug a leak in the index unmerged entries vector
Vicent Martí [Wed, 1 Jun 2011 19:52:50 +0000 (12:52 -0700)]
Merge pull request #222 from carlosmn/config-bugfix
Config bugfix
Vicent Martí [Wed, 1 Jun 2011 16:58:21 +0000 (09:58 -0700)]
Merge pull request #206 from nulltoken/topic/is-bare
Add git_repository_is_bare() accessor
Vicent Marti [Wed, 1 Jun 2011 16:51:54 +0000 (18:51 +0200)]
index: Cleanup tree parsing
Carlos Martín Nieto [Tue, 24 May 2011 13:24:45 +0000 (15:24 +0200)]
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>
Carlos Martín Nieto [Tue, 24 May 2011 12:55:34 +0000 (14:55 +0200)]
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>
Vicent Marti [Wed, 1 Jun 2011 16:34:21 +0000 (18:34 +0200)]
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.
Vicent Marti [Wed, 1 Jun 2011 16:23:36 +0000 (18:23 +0200)]
object: Update documentation
David Glesser [Tue, 31 May 2011 16:38:59 +0000 (18:38 +0200)]
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.
Carlos Martín Nieto [Tue, 31 May 2011 15:54:50 +0000 (17:54 +0200)]
Add test for empty config file
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto [Tue, 31 May 2011 15:44:55 +0000 (17:44 +0200)]
Don't try to parse an empty config file
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto [Tue, 31 May 2011 14:31:19 +0000 (16:31 +0200)]
Add test for invalid ext header
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto [Tue, 31 May 2011 14:06:01 +0000 (16:06 +0200)]
Add config test for empty line
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Carlos Martín Nieto [Tue, 31 May 2011 13:16:25 +0000 (15:16 +0200)]
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>
Carlos Martín Nieto [Tue, 31 May 2011 13:11:49 +0000 (15:11 +0200)]
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>
Carlos Martín Nieto [Tue, 31 May 2011 13:06:22 +0000 (15:06 +0200)]
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>
Carlos Martín Nieto [Sat, 28 May 2011 23:24:09 +0000 (01:24 +0200)]
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>
Carlos Martín Nieto [Tue, 31 May 2011 11:48:44 +0000 (13:48 +0200)]
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>
Carlos Martín Nieto [Tue, 31 May 2011 14:49:15 +0000 (16:49 +0200)]
Plug a leak in the index unmerged entries vector
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
schu [Mon, 30 May 2011 19:13:11 +0000 (21:13 +0200)]
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>
schu [Sun, 29 May 2011 18:15:27 +0000 (20:15 +0200)]
Fix tiny typo
Signed-off-by: nulltoken <emeric.fermas@gmail.com>
Signed-off-by: schu <schu-github@schulog.org>
schu [Sun, 29 May 2011 15:44:14 +0000 (17:44 +0200)]
gitfo_isdir: fix error message
Signed-off-by: schu <schu-github@schulog.org>
nulltoken [Tue, 24 May 2011 19:48:07 +0000 (21:48 +0200)]
Add git_repository_is_bare() accessor
Vicent Martí [Tue, 24 May 2011 17:02:33 +0000 (10:02 -0700)]
Merge pull request #204 from nulltoken/fix/build-msvc
Fix compilation warnings in MSVC
nulltoken [Tue, 24 May 2011 16:55:35 +0000 (18:55 +0200)]
Fix compilation warnings in MSVC
This allows to successfully build libgit2 with waf on Windows.
Vicent Marti [Mon, 23 May 2011 18:41:13 +0000 (21:41 +0300)]
index: Fix unused error messages
Jakob Pfender [Thu, 19 May 2011 13:59:18 +0000 (15:59 +0200)]
index.c: Move to new error handling mechanism
Jakob Pfender [Thu, 19 May 2011 13:46:36 +0000 (15:46 +0200)]
config_file.c: Move to new error handling mechanism
Jakob Pfender [Thu, 19 May 2011 13:37:10 +0000 (15:37 +0200)]
win32/pthread.c: Move to new error handling mechanism
Jakob Pfender [Thu, 19 May 2011 13:36:09 +0000 (15:36 +0200)]
win32/map.c: Move to new error handling mechanism
Jakob Pfender [Thu, 19 May 2011 13:29:22 +0000 (15:29 +0200)]
unix/map.c: Move to new error handling mechanism
Jakob Pfender [Thu, 19 May 2011 13:24:24 +0000 (15:24 +0200)]
backends/sqlite.c: Move to new error handling mechanism
Jakob Pfender [Thu, 19 May 2011 13:17:06 +0000 (15:17 +0200)]
backends/hiredis.c: Move to new error handling mechanism
Jakob Pfender [Thu, 19 May 2011 13:13:40 +0000 (15:13 +0200)]
util.c: Move to new error handling mechanism
Jakob Pfender [Thu, 19 May 2011 13:10:54 +0000 (15:10 +0200)]
tree.c: Move to new error handling mechanism
Jakob Pfender [Thu, 19 May 2011 13:07:41 +0000 (15:07 +0200)]
tag.c: Move to new error handling mechanism
Jakob Pfender [Thu, 19 May 2011 12:59:10 +0000 (14:59 +0200)]
signature.c: Move to new error handling mechanism
Jakob Pfender [Thu, 19 May 2011 12:57:41 +0000 (14:57 +0200)]
revwalk.c: Move to new error handling mechanism
Jakob Pfender [Thu, 19 May 2011 12:51:16 +0000 (14:51 +0200)]
repository.c: Move to new error handling mechanism
Vicent Marti [Mon, 23 May 2011 18:37:48 +0000 (21:37 +0300)]
refs: Reword errors
Jakob Pfender [Thu, 19 May 2011 12:36:52 +0000 (14:36 +0200)]
refs.c: Move to new error handling mechanism
Jakob Pfender [Thu, 19 May 2011 11:50:46 +0000 (13:50 +0200)]
oid.c: Move to new error handling mechanism
Vicent Marti [Mon, 23 May 2011 18:14:58 +0000 (21:14 +0300)]
odb_pack: Reword errors
Jakob Pfender [Thu, 19 May 2011 11:38:12 +0000 (13:38 +0200)]
odb_pack.c: Move to new error handling mechanism
Vicent Marti [Mon, 23 May 2011 18:12:18 +0000 (21:12 +0300)]
odb_loose: Reword errors
Jakob Pfender [Thu, 19 May 2011 10:28:46 +0000 (12:28 +0200)]
odb_loose.c: Move to new error handling mechanism
Jakob Pfender [Thu, 19 May 2011 10:27:43 +0000 (12:27 +0200)]
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.
Vicent Marti [Mon, 23 May 2011 18:09:07 +0000 (21:09 +0300)]
odb: Reword errors
Jakob Pfender [Wed, 18 May 2011 10:35:08 +0000 (12:35 +0200)]
odb.c: Move to new error handling mechanism
Vicent Marti [Mon, 23 May 2011 18:05:43 +0000 (21:05 +0300)]
object: Reword errors
Jakob Pfender [Wed, 18 May 2011 10:19:48 +0000 (12:19 +0200)]
object.c: Move to new error handling mechanism
Vicent Marti [Mon, 23 May 2011 18:04:09 +0000 (21:04 +0300)]
hashtable: Reword errors
Jakob Pfender [Wed, 18 May 2011 10:12:16 +0000 (12:12 +0200)]
hashtable.c: Move to new error handling mechanism
Vicent Marti [Mon, 23 May 2011 18:03:01 +0000 (21:03 +0300)]
fileops: Cleanup
Jakob Pfender [Tue, 17 May 2011 16:02:08 +0000 (18:02 +0200)]
fileops.c: Move to new error handling mechanism
Vicent Marti [Mon, 23 May 2011 18:00:19 +0000 (21:00 +0300)]
filebuf: Reword errors
Jakob Pfender [Tue, 17 May 2011 15:43:00 +0000 (17:43 +0200)]
filebuf.c: Move to new error handling mechanism
Jakob Pfender [Tue, 17 May 2011 15:24:28 +0000 (17:24 +0200)]
config.c: Fix format string error
Jakob Pfender [Tue, 17 May 2011 15:22:33 +0000 (17:22 +0200)]
delta-apply.c: Move to new error handling mechanism
Jakob Pfender [Tue, 17 May 2011 15:21:00 +0000 (17:21 +0200)]
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.
Vicent Marti [Mon, 23 May 2011 17:43:19 +0000 (20:43 +0300)]
config: Cleanup
Vicent Marti [Mon, 23 May 2011 17:36:06 +0000 (20:36 +0300)]
commit: Reword errors
Jakob Pfender [Tue, 17 May 2011 15:00:37 +0000 (17:00 +0200)]
commit.c: Move to new error handling mechanism
Vicent Marti [Mon, 23 May 2011 17:33:20 +0000 (20:33 +0300)]
blob: Reword errors
Jakob Pfender [Tue, 17 May 2011 14:50:49 +0000 (16:50 +0200)]
blob.c: Move to new error handling mechanism
Vicent Marti [Fri, 20 May 2011 00:20:12 +0000 (03:20 +0300)]
config: Cleanup & renaming of the external API
"git_config_backend" have been renamed to "git_config_file", which
implements a generic interface to access a configuration file -- be it
either on disk, from a DB or whatever mumbojumbo.
I think this makes more sense.
Vicent Marti [Thu, 19 May 2011 23:58:33 +0000 (02:58 +0300)]
Rewrite `git_config_open_global`
We have a lot of utility methods that make path building trivial. Use
them!
Vicent Martí [Thu, 19 May 2011 21:18:57 +0000 (14:18 -0700)]
Merge pull request #193 from carlosmn/config
A couple of config improvements
Vicent Martí [Thu, 19 May 2011 18:21:22 +0000 (11:21 -0700)]
Merge pull request #198 from sschuberth/fix-typos
Fix a few minor typos in comments and error messages
Vicent Marti [Thu, 19 May 2011 17:38:17 +0000 (20:38 +0300)]
index: Fix issues in the unmerged entries API