]> git.proxmox.com Git - libgit2.git/log
libgit2.git
13 years agoadd examples for docs
Scott Chacon [Tue, 14 Jun 2011 16:27:46 +0000 (09:27 -0700)]
add examples for docs

13 years agoreplace stupid doxygen
Scott Chacon [Tue, 14 Jun 2011 15:17:53 +0000 (08:17 -0700)]
replace stupid doxygen

13 years agoAdd CTest support for CI
Vicent Marti [Tue, 14 Jun 2011 18:00:06 +0000 (20:00 +0200)]
Add CTest support for CI

13 years agofix gid_ misspelling
Scott Chacon [Tue, 14 Jun 2011 16:31:19 +0000 (09:31 -0700)]
fix gid_ misspelling

13 years agoPort MSVC specific Waf compilation flags to CMake and remove dynamic dependence to...
Em [Tue, 14 Jun 2011 13:37:10 +0000 (06:37 -0700)]
Port MSVC specific Waf compilation flags to CMake and remove dynamic dependence to msvcr100.dll on Windows

The '/MT' and '/MTd' flags replace the dynamic link to 'msvcr100.dll' with a static link to 'libcmt.lib'. This has the nice effect to ease the deployment of libgit2 by removing the dependence on 'msvcr100.dll' which is not deployed by default on Windows.

13 years agoUpdate README.md
Vicent Marti [Tue, 14 Jun 2011 15:36:38 +0000 (17:36 +0200)]
Update README.md

13 years agobuild: Cleanup CMake
Vicent Marti [Mon, 13 Jun 2011 20:33:32 +0000 (22:33 +0200)]
build: Cleanup CMake

13 years agobuild: Drop waf support
Vicent Marti [Mon, 13 Jun 2011 13:34:34 +0000 (15:34 +0200)]
build: Drop waf support

Goodbye Waf. It's been a long ride.

13 years agoRemove custom backends
Vicent Marti [Sun, 12 Jun 2011 09:40:14 +0000 (11:40 +0200)]
Remove custom backends

All the custom backend code will be moved to a separate project,
together with the new MySQL backend.

13 years agoMerge pull request #258 from carlosmn/no-arpa
Vicent Martí [Tue, 14 Jun 2011 15:28:03 +0000 (08:28 -0700)]
Merge pull request #258 from carlosmn/no-arpa

Remove uneeded arpa/inet.h include

13 years agoRemove uneeded arpa/inet.h include
Carlos Martín Nieto [Tue, 14 Jun 2011 14:35:57 +0000 (16:35 +0200)]
Remove uneeded arpa/inet.h include

This header isn't needed at all and it shows a lot of warnings on
OpenBSD.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agouse proper in-memory database for sqlite3 tests
Brian Lopez [Sun, 12 Jun 2011 05:05:26 +0000 (22:05 -0700)]
use proper in-memory database for sqlite3 tests

13 years agoMerge pull request #253 from sschuberth/msvc10-fixes
Vicent Martí [Sat, 11 Jun 2011 18:56:10 +0000 (11:56 -0700)]
Merge pull request #253 from sschuberth/msvc10-fixes

Msvc10 fixes

13 years agoAdd missing function declarations to avoid MSVC compiler warnings
Sebastian Schuberth [Fri, 10 Jun 2011 12:00:54 +0000 (14:00 +0200)]
Add missing function declarations to avoid MSVC compiler warnings

The better solution would probably be to turn the gitfo_lstat /
gitfo_readlink macros into real functions that wrap either lstat or
gitfo_lstat__w32 (and readlink or gitfo_readlink__w32). However, that
would introduce an indirection unless inlined. For now, this is the less
intrusive change.

13 years agoUse "__inline" instead of "inline" with MSVC
Sebastian Schuberth [Fri, 10 Jun 2011 11:57:01 +0000 (13:57 +0200)]
Use "__inline" instead of "inline" with MSVC

MSVC supports "inline" only in C++ code, not in C code.

13 years agoPrefer to use file mode defines instead of raw numbers
Sebastian Schuberth [Fri, 10 Jun 2011 11:56:24 +0000 (13:56 +0200)]
Prefer to use file mode defines instead of raw numbers

13 years agoPrefer to use S_IFLNK instead of _S_IFLNK for consistency
Sebastian Schuberth [Fri, 10 Jun 2011 11:54:47 +0000 (13:54 +0200)]
Prefer to use S_IFLNK instead of _S_IFLNK for consistency

13 years agoAdd some missing MSVC compatibility defines
Sebastian Schuberth [Fri, 10 Jun 2011 11:54:25 +0000 (13:54 +0200)]
Add some missing MSVC compatibility defines

13 years agoMerge pull request #216 from glesserd/development
Vicent Martí [Wed, 8 Jun 2011 15:11:26 +0000 (08:11 -0700)]
Merge pull request #216 from glesserd/development

git_tag_create{,_o,_frombuffer} correction and improvement

13 years agoMerge pull request #250 from pegonma/commit_short_message
Vicent Martí [Wed, 8 Jun 2011 15:09:54 +0000 (08:09 -0700)]
Merge pull request #250 from pegonma/commit_short_message

Commit short message should be the same as git's

13 years agowindows: Fix Symlink issues
Vicent Marti [Wed, 8 Jun 2011 15:03:41 +0000 (17:03 +0200)]
windows: Fix Symlink issues

Handle Symlinks if they can be handled in Win32. This is not even
compiled. Needs review.

The lstat implementation is modified from core Git.
The readlink implementation is modified from PHP.

13 years agoMerge pull request #246 from carlosmn/keep-lock
Vicent Martí [Wed, 8 Jun 2011 11:16:47 +0000 (04:16 -0700)]
Merge pull request #246 from carlosmn/keep-lock

Keep the lockfile if we fail to lock it

13 years agoChanged commit short messages so that they match git log --oneline output.
Marc Pegon [Wed, 8 Jun 2011 09:16:31 +0000 (11:16 +0200)]
Changed commit short messages so that they match git log --oneline output.

In git, the short message of a commit is the part of the commit message before 2 consecutive line breaks. In the short message, line breaks are replaced by space characters.

13 years agofilebuf cleanup: only unlink lockfile if we've opened it
Carlos Martín Nieto [Tue, 7 Jun 2011 15:03:07 +0000 (17:03 +0200)]
filebuf cleanup: only unlink lockfile if we've opened it

Add a check for the file descriptor in git_filebuf_cleanup. Without
it, an existing lockfile would be deleted if we tried to acquire it
(but failed, as the lockfile already existed).

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoAdd test for git_filebuf_open error code
Carlos Martín Nieto [Tue, 7 Jun 2011 14:51:31 +0000 (16:51 +0200)]
Add test for git_filebuf_open error code

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoMerge pull request #243 from jpfender/symlinks2
Vicent Martí [Tue, 7 Jun 2011 14:07:45 +0000 (07:07 -0700)]
Merge pull request #243 from jpfender/symlinks2

Symlinks NEW

13 years agoMerge pull request #245 from schu/use-normalized
Vicent Martí [Tue, 7 Jun 2011 14:04:51 +0000 (07:04 -0700)]
Merge pull request #245 from schu/use-normalized

rename-reference: use normalized path

13 years agoMerge pull request #244 from carlosmn/config-bugfix
Vicent Martí [Tue, 7 Jun 2011 14:04:20 +0000 (07:04 -0700)]
Merge pull request #244 from carlosmn/config-bugfix

config: update the git_config_add_file documentation

13 years agoMerge pull request #241 from nulltoken/fix/msvc-warnings
Vicent Martí [Tue, 7 Jun 2011 14:03:37 +0000 (07:03 -0700)]
Merge pull request #241 from nulltoken/fix/msvc-warnings

Fix compilation warnings in MSVC

13 years agoMerge pull request #242 from schu/fix-unused-2
Vicent Martí [Tue, 7 Jun 2011 14:03:14 +0000 (07:03 -0700)]
Merge pull request #242 from schu/fix-unused-2

fileops.c: fix unused warning v2

13 years agoconfig: explain the cfg and file relationship better
Carlos Martín Nieto [Tue, 7 Jun 2011 13:39:40 +0000 (15:39 +0200)]
config: explain the cfg and file relationship better

It's not clear how git_config and git_config_file relate to one
another. Be more explicit about their relationship in the function
documentation.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agoconfig: update the git_config_add_file documentation
Carlos Martín Nieto [Tue, 7 Jun 2011 12:18:22 +0000 (14:18 +0200)]
config: update the git_config_add_file documentation

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
13 years agorename-reference: use normalized path
schu [Tue, 7 Jun 2011 12:18:20 +0000 (14:18 +0200)]
rename-reference: use normalized path

Signed-off-by: schu <schu-github@schulog.org>
13 years agoExport gitfo_shallow_exists
Jakob Pfender [Tue, 7 Jun 2011 12:15:55 +0000 (14:15 +0200)]
Export gitfo_shallow_exists

13 years agofileops: Allow differentiation between deep and shallow exists()
Jakob Pfender [Tue, 7 Jun 2011 12:10:06 +0000 (14:10 +0200)]
fileops: Allow differentiation between deep and shallow exists()

When calling gitfo_exists() on a symbolic link, sometimes we need to
simply check whether the link exists and sometimes we need to check
whether the file pointed to by the symlink exists.

Introduce a new function gitfo_shallow_exists that only checks if the
link exists and revert gitfo_exists to the original functionality of
checking whether the file pointed to by the link exists.

13 years agoRevert "common: Include stat.h in include/git2/common.h instead of src/common.h"
Jakob Pfender [Tue, 7 Jun 2011 09:15:23 +0000 (11:15 +0200)]
Revert "common: Include stat.h in include/git2/common.h instead of src/common.h"

This reverts commit df1c98ab6d6171ed63729195bd190b54b67fe530.

As 8a27b6b reverts the exposition of struct stat to the external API, we
do not need - indeed, do not want - struct stat to be in the outer
include layer.

13 years agoblob: Stat path inside git_blob_create_fromfile
Jakob Pfender [Tue, 7 Jun 2011 09:11:09 +0000 (11:11 +0200)]
blob: Stat path inside git_blob_create_fromfile

00582bc introduced a change that required the caller of
git_blob_create_fromfile() to pass a struct stat with the stat
information for the file. Several developers pointed out that this would
make life hard for the bindings developers as struct stat isn't widely
supported by other languages.

Make git_blob_create_fromfile() stat the path itself, eliminating the
need for the file to be stat'ed by the caller. This makes
index_init_entry() more costly as the file will be stat'ed twice but
makes life easier for everyone else.

13 years agocommon: Include stat.h in include/git2/common.h instead of src/common.h
Jakob Pfender [Wed, 25 May 2011 14:31:14 +0000 (16:31 +0200)]
common: Include stat.h in include/git2/common.h instead of src/common.h

00582bcb introduced a change to git_blob_create_fromfile() that required
the caller to pass a stat struct. This means that we need to include
stat.h higher in the hierarchy of includes.

13 years agoindex: Correctly write entry mode
Jakob Pfender [Wed, 25 May 2011 14:16:41 +0000 (16:16 +0200)]
index: Correctly write entry mode

The entry mode flags for an entry created from a path name were not
correctly written if the entry was a symlink. The st_mode of a statted
symlink is 0120777, however git requires the mode to read 0120000,
because it does not care about permissions of symlinks.

Introduce index_create_mode() that correctly writes the mode flags in
the form expected by git.

13 years agoindex/fileops: Correctly process symbolic links
Jakob Pfender [Wed, 25 May 2011 14:11:57 +0000 (16:11 +0200)]
index/fileops: Correctly process symbolic links

gitfo_exists() used to error out if the given file was a symbolic link,
due to access() returning an error code. This is not expected behaviour,
as gitfo_exists() should only check whether the file itself exists, not
its link target if it is a symbolic link.

Fix this by calling gitfo_lstat() instead, which is just a wrapper for
lstat().

Also fix the same error in index_init_entry().

13 years agoblob: Require stat information for git_blob_create_fromfile()
Jakob Pfender [Wed, 25 May 2011 14:04:29 +0000 (16:04 +0200)]
blob: Require stat information for git_blob_create_fromfile()

In order to be able to write symlinks with git_blob_create_fromfile(),
we need to check whether the file to be written is a symbolic link or
not. Since the calling function of git_blob_create_fromfile() is likely to have
stated the file before calling, we make it pass the stat.

The reason for this is that writing symbolic link blobs is significantly
different from writing ordinary files - we do not want to open the link
destination but instead want to write the link itself, regardless of
whether it exists or not.

Previously, index_init_entry() used to error out if the file to be added
was a symlink that pointed to a nonexistent file. Fix this behaviour to
add the file regardless of whether it exists. This mimics git.git's
behaviour.

13 years agoFix the error pointed out by tanoku.
David Glesser [Tue, 7 Jun 2011 08:15:31 +0000 (10:15 +0200)]
Fix the error pointed out by tanoku.

Now the code shoulb be c89.

13 years agoFix compilation warnings in MSVC
nulltoken [Tue, 7 Jun 2011 06:41:33 +0000 (08:41 +0200)]
Fix compilation warnings in MSVC

13 years agothreads: Cleanup TLS declarations
Vicent Marti [Tue, 7 Jun 2011 01:39:19 +0000 (03:39 +0200)]
threads: Cleanup TLS declarations

This time for good.

13 years agoRevert "threads: Fix TLS declarations"
Vicent Marti [Tue, 7 Jun 2011 01:38:09 +0000 (03:38 +0200)]
Revert "threads: Fix TLS declarations"

This commit uploaded an old broken test. Oops!

13 years agoMerge pull request #240 from Romain-Geissler/tree-object-type
Vicent Martí [Tue, 7 Jun 2011 01:33:38 +0000 (18:33 -0700)]
Merge pull request #240 from Romain-Geissler/tree-object-type

Tree: Added a function that returns the type of a tree entry.

13 years agoMerge pull request #239 from pegonma/oid_prefix
Vicent Martí [Tue, 7 Jun 2011 01:31:21 +0000 (18:31 -0700)]
Merge pull request #239 from pegonma/oid_prefix

Search objects of different types given OID prefix

13 years agoMerge pull request #238 from pegonma/git_oid_ncmp
Vicent Martí [Tue, 7 Jun 2011 01:28:11 +0000 (18:28 -0700)]
Merge pull request #238 from pegonma/git_oid_ncmp

Better name for git_oid_match

13 years agoMerge pull request #236 from Jopie64/development
Vicent Martí [Tue, 7 Jun 2011 01:27:29 +0000 (18:27 -0700)]
Merge pull request #236 from Jopie64/development

Fix build errors on MSVC

13 years agoMerge pull request #234 from Romain-Geissler/entry-count-API-uniformisation
Vicent Martí [Tue, 7 Jun 2011 01:26:50 +0000 (18:26 -0700)]
Merge pull request #234 from Romain-Geissler/entry-count-API-uniformisation

[Tree | Index] API uniformisation

13 years agoMerge pull request #232 from schu/ref-available-cb
Vicent Martí [Tue, 7 Jun 2011 01:24:37 +0000 (18:24 -0700)]
Merge pull request #232 from schu/ref-available-cb

reference_rename: respect all references v2

13 years agothreads: Fix TLS declarations
Vicent Marti [Tue, 7 Jun 2011 01:22:32 +0000 (03:22 +0200)]
threads: Fix TLS declarations

Cleanup the thread-utils file. Do not define TLS if libgit2 is not
threadsafe.

13 years agoMerge pull request #231 from Romain-Geissler/discovery-path-v2
Vicent Martí [Tue, 7 Jun 2011 01:11:15 +0000 (18:11 -0700)]
Merge pull request #231 from Romain-Geissler/discovery-path-v2

[Discovery path] Fix and tests

13 years agoTree: Added a function that returns the type of a tree entry.
Romain Geissler [Mon, 6 Jun 2011 15:14:30 +0000 (17:14 +0200)]
Tree: Added a function that returns the type of a tree entry.

13 years agoRenamed git_oid_match to git_oid_ncmp.
Marc Pegon [Mon, 6 Jun 2011 08:55:36 +0000 (10:55 +0200)]
Renamed git_oid_match to git_oid_ncmp.
As suggested by carlosmn, git_oid_ncmp would probably
be a better name than git_oid_match, for it does the same
as git_oid_cmp but only up to a certain amount of hex digits.

13 years agofileops.c: fix unused warning
schu [Mon, 6 Jun 2011 10:17:58 +0000 (12:17 +0200)]
fileops.c: fix unused warning

Signed-off-by: schu <schu-github@schulog.org>
13 years agoAdded methods to search objects of different types
Marc Pegon [Mon, 6 Jun 2011 09:55:48 +0000 (11:55 +0200)]
Added methods to search objects of different types
given an OID prefix.

13 years agoTree: Some more size_t to unsigned int type change.
Romain Geissler [Mon, 6 Jun 2011 08:55:54 +0000 (10:55 +0200)]
Tree: Some more size_t to unsigned int type change.

13 years agoRepository: A little fix in error code. GIT_ENOTFOUND is returned when a gitfile...
Romain Geissler [Mon, 6 Jun 2011 08:02:07 +0000 (10:02 +0200)]
Repository: A little fix in error code. GIT_ENOTFOUND is returned when a gitfile is malformed and GIT_ENOTAREPO when the pointed dir is not a repo.
Fixed tests so that it check the right error code.

13 years agofilebuf: Fix printf buffer overflows
Vicent Marti [Sun, 5 Jun 2011 23:54:59 +0000 (01:54 +0200)]
filebuf: Fix printf buffer overflows

The filebuf was not being properly written after a flush. This should
cut it now.

Fixes #228

13 years agorefs: Improve error messages
Vicent Marti [Sun, 5 Jun 2011 23:54:25 +0000 (01:54 +0200)]
refs: Improve error messages

13 years agoRepository: Fixed retrieve_device return type.
Romain Geissler [Sun, 5 Jun 2011 23:26:01 +0000 (01:26 +0200)]
Repository: Fixed retrieve_device return type.

13 years agoFix build errors on MSVC
Johan 't Hart [Sun, 5 Jun 2011 22:33:23 +0000 (00:33 +0200)]
Fix build errors on MSVC

13 years agoIndex: API uniformisation: Use unsigned int for all index number.
Romain Geissler [Sun, 5 Jun 2011 19:19:03 +0000 (21:19 +0200)]
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).

13 years agoTree: API uniformasation: Use unsigned int for all index number.
Romain Geissler [Sun, 5 Jun 2011 19:18:05 +0000 (21:18 +0200)]
Tree: API uniformasation: Use unsigned int for all index number.

13 years agoRaise GIT_EEXISTS in case of conflicting ref names instead of passing
schu [Sun, 5 Jun 2011 18:47:30 +0000 (20:47 +0200)]
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>
13 years agoTeach reference_rename() to really respect other references
schu [Sun, 5 Jun 2011 17:22:32 +0000 (19:22 +0200)]
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>
13 years agoAdd test case checking we do not corrupt the repository when renaming
schu [Sun, 29 May 2011 20:36:26 +0000 (22:36 +0200)]
Add test case checking we do not corrupt the repository when renaming

Signed-off-by: schu <schu-github@schulog.org>
13 years agoTests: Added tests for git_repository_discover.
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.

13 years agoFileops: Fixed gitfo_mkdir_recurs so that it proprely works with a path without trail...
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.

13 years agoRepository: Fixed the path returned by read_gitfile (remove trailing slashes)
Romain Geissler [Sat, 4 Jun 2011 22:18:34 +0000 (00:18 +0200)]
Repository: Fixed the path returned by read_gitfile (remove trailing slashes)

13 years agoRepository: Fixed a bug in read_gitfile (proprely remove trailings newlines)
Romain Geissler [Sat, 4 Jun 2011 22:17:26 +0000 (00:17 +0200)]
Repository: Fixed a bug in read_gitfile (proprely remove trailings newlines)

13 years agorepository: Export all internal paths
Vicent Marti [Sat, 4 Jun 2011 18:44:14 +0000 (20:44 +0200)]
repository: Export all internal paths

13 years agoRepository: Fixed some errors with ceiling_dirs in git_repository_discover.
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.

13 years agoChange a dirty indentation
David Glesser [Sat, 4 Jun 2011 14:09:19 +0000 (16:09 +0200)]
Change a dirty indentation

13 years agoMerge pull request #227 from Romain-Geissler/discovery-path-v2
Vicent Martí [Sat, 4 Jun 2011 00:41:53 +0000 (17:41 -0700)]
Merge pull request #227 from Romain-Geissler/discovery-path-v2

Discovery path v2

13 years agoRepository: Added the git_repository_discover function that finds by itself the git...
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.

13 years agoRepository: Splitted the repository destructor into a helper part (only free director...
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.

13 years agoRepository: Added read_gitfile that allows you to read a .git file and extract the...
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.

13 years agoRepository: Added some util functions that we'll need to discover repository 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).

13 years agoFilebuf: Fixed a TODO in filebuf (real lock in lock_file)
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

13 years agoindex: Add `git_index_entry_stage` method
Vicent Marti [Fri, 3 Jun 2011 19:38:55 +0000 (21:38 +0200)]
index: Add `git_index_entry_stage` method

As suggested by Romain-Geissler

13 years agoFileops: Added gitfo_isfile.
Romain Geissler [Fri, 3 Jun 2011 19:09:14 +0000 (21:09 +0200)]
Fileops: Added gitfo_isfile.

Conflicts:

src/fileops.c

13 years agoFileops: Added a fourth argument to the path prettifying functions to use an alternat...
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.

13 years agoSha1Lookup: Fixed two MSVC compilation warnings.
unknown [Fri, 3 Jun 2011 17:38:46 +0000 (19:38 +0200)]
Sha1Lookup: Fixed two MSVC compilation warnings.

13 years agoodb: Fix loading ODB alternates
Vicent Marti [Fri, 3 Jun 2011 17:59:16 +0000 (19:59 +0200)]
odb: Fix loading ODB alternates

Fixed an issue with the `strtokz implementation and added support for
comments and relative paths in the alternates file.

13 years agoFileops:retrieve_path_root_offset is now named gitfo_retrieve_path_root_offset (like...
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.

13 years agoMerge pull request #144 from nordsturm/fix_fakewstream
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

13 years agoodb-pack: More variable declarations
Vicent Marti [Wed, 1 Jun 2011 23:03:52 +0000 (01:03 +0200)]
odb-pack: More variable declarations

13 years agoodb-pack: Do not declare variables mid-function
Vicent Marti [Wed, 1 Jun 2011 22:47:51 +0000 (00:47 +0200)]
odb-pack: Do not declare variables mid-function

13 years agosignature: Fix compilation
Vicent Marti [Wed, 1 Jun 2011 21:41:30 +0000 (23:41 +0200)]
signature: Fix compilation

13 years agoshort-oid: Cleanup
Vicent Marti [Wed, 1 Jun 2011 19:25:56 +0000 (21:25 +0200)]
short-oid: Cleanup

13 years agoImplemented read_unique_short_oid method for loose backend.
Marc Pegon [Sun, 29 May 2011 16:00:35 +0000 (18:00 +0200)]
Implemented read_unique_short_oid method for loose backend.

13 years agoFixed some error messages related to searching objects from a short oid. Fixed forgot...
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.

13 years agoDeleted unused method git_cached_object_match, since we do not explore the cache...
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.

13 years agoChanged return value of git_oid_match to be consistent with the other compare methods...
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.

13 years agoAdded a GIT_OID_MINPREFIXLEN constant to define the minimum length allowed for oid...
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.

13 years agoAdded git.git sha1 lookup method to replace simple binary search in pack backend.
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.

13 years agoAdded error for ambiguous oid prefixes. Added methods to compare the first nth hexade...
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.

13 years agoAdded a read_unique_short_oid method to backends, to make it possible to find objects...
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).