Commit Graph

32 Commits

Author SHA1 Message Date
nulltoken
7623b1b63f repository: make git_repository_init() value the core.logallrefupdates config entry 2012-06-12 06:42:46 +02:00
nulltoken
976b69bdbb repository: widen test coverage regarding initialization and configuration entries 2012-06-12 06:42:46 +02:00
nulltoken
693b23c09a repository: make git_repository_init() value the core.ignorecase config entry 2012-06-05 22:33:34 +02:00
nulltoken
fac66990b6 repository: make git_repository_init() value the core.filemode config entry 2012-06-05 14:01:44 +02:00
Vicent Martí
904b67e69f errors: Rename error codes 2012-05-18 01:48:50 +02:00
Vicent Martí
e172cf082e errors: Rename the generic return codes 2012-05-18 01:26:26 +02:00
Russell Belfer
db62807215 Fixed leaks and added tests 2012-05-11 12:16:19 -07:00
nulltoken
464cf248fd repository: ensure git_repository_discover() returns ENOTFOUND when unable to find a repository given the constraints 2012-05-08 10:05:24 +02:00
nulltoken
0b0957a661 fileops: replace integer usage with more explicit enum in some git_futils_rmdir_r() calls 2012-05-08 10:05:22 +02:00
nulltoken
d7d8a0bfd4 repository: ensure git_repository_open() returns ENOTFOUND when being passed a path leading to no repository 2012-05-08 10:05:20 +02:00
Vicent Martí
b02bcd97f8 Boom 2012-05-02 16:57:16 -07:00
Vicent Martí
946a6dc4e6 Update test suite 2012-05-02 16:14:30 -07:00
Vicent Martí
40879facad Merge branch 'new-error-handling' into development
Conflicts:
	.travis.yml
	include/git2/diff.h
	src/config_file.c
	src/diff.c
	src/diff_output.c
	src/mwindow.c
	src/path.c
	tests-clar/clar_helpers.c
	tests-clar/object/tree/frompath.c
	tests/t00-core.c
	tests/t03-objwrite.c
	tests/t08-tag.c
	tests/t10-refs.c
	tests/t12-repo.c
	tests/t18-status.c
	tests/test_helpers.c
	tests/test_main.c
2012-05-02 15:59:02 -07:00
Vicent Martí
f9f2344bd4 Merge pull request #632 from arrbee/win64-cleanup
Code clean up, including fixing warnings on Windows 64-bit build
2012-04-23 17:28:11 -07:00
Vicent Martí
4795807ad5 Merge pull request #637 from nulltoken/issue/odb-refcount
Fix git_repository_set_odb() refcount issue
2012-04-23 17:25:11 -07:00
nulltoken
baf861a511 Fix git_repository_set_odb() refcount issue
git_repository_free() calls git_odb_free() if the owned odb is not null.

According to the doc, when setting a new odb through git_repository_set_odb() the caller has to take care of releasing the odb by himself.
2012-04-23 11:07:19 +02:00
Vicent Martí
54e4d0f25b Merge pull request #629 from nulltoken/issue/index-refcount
Index refcount issue
2012-04-18 17:34:52 -07:00
Russell Belfer
44ef8b1b30 Fix warnings on 64-bit windows builds
This fixes all the warnings on win64 except those in deps, which
come from the regex code.
2012-04-17 10:47:39 -07:00
schu
3fa1ec4af6 tests-clar/repo: fix unused warning
ifdef GIT_WIN32 helper unposix_path() to avoid unused-function warning
on non-Windows systems.

Signed-off-by: schu <schu-github@schulog.org>
2012-04-15 20:30:12 +02:00
nulltoken
c1aefb35dd Fix git_repository_set_index() refcount issue
git_repository_free() calls git_index_free() if the owned index is not null.

According to the doc, when setting a new index through git_repository_set_index() the caller has still to take care of releasing the index by itself.

In order to cope with this, this fix makes sure the index refcount is incremented when a new repository is being plugged a new index.
2012-04-14 15:05:38 +02:00
nulltoken
fdd1149c29 Fix MSVC compilation warnings
Removed unreferenced variables.
2012-04-14 13:46:13 +02:00
Russell Belfer
7784bcbbee Refactor git_repository_open with new options
Add a new command `git_repository_open_ext` with extended options
that control how searching for a repository will be done.  The
existing `git_repository_open` and `git_repository_discover` are
reimplemented on top of it.  We may want to change the default
behavior of `git_repository_open` but this commit does not do that.

Improve support for "gitdir" files where the work dir is separate
from the repo and support for the "separate-git-dir" config.  Also,
add support for opening repos created with `git-new-workdir` script
(although I have only confirmed that they can be opened, not that
all functions work correctly).

There are also a few minor changes that came up:

- Fix `git_path_prettify` to allow in-place prettifying.

- Fix `git_path_root` to support backslashes on Win32.  This fix
  should help many repo open/discover scenarios - it is the one
  function called when opening before prettifying the path.

- Tweak `git_config_get_string` to set the "out" pointer to NULL
  if the config value is not found.  Allows some other cleanup.

- Fix a couple places that should have been calling
  `git_repository_config__weakptr` and were not.

- Fix `cl_git_sandbox_init` clar helper to support bare repos.
2012-04-11 12:11:35 -07:00
Russell Belfer
1de77cd314 Cannot set workdir to a nonexistent dir 2012-04-11 12:10:14 -07:00
nulltoken
b78fb64d2f repository: make git_repository_set_workdir() prettify the path it is being passed 2012-04-11 12:40:21 +02:00
Ben Straub
b173121555 Simple readability fixes. 2012-03-31 20:12:29 -07:00
Ben Straub
20ec426dde Discovered cl_git_strequal! Mounted a crusade! 2012-03-31 19:47:59 -07:00
Ben Straub
270303ca7a Moved more assertions inside Clar test helpers. 2012-03-31 15:51:35 -07:00
Ben Straub
7c3a4a7f07 t12-repo.c ported, although kind of messy.
It'd be nice to be rid of all the #define's, but converting to const
char*'s would be even messier, and less declarative.
2012-03-30 12:26:39 -07:00
nulltoken
99abb79d53 repository: ensure that the path to the .git directory ends with a forward slash when opening a repository through a working directory path
This fixes an issue which was detected while using one of the libgit2 bindings [0]. The lack of the trailing forward slash led the name of references returned by git_reference_listall() to be prefixed with a forward slash.

  [0]: https://github.com/libgit2/libgit2sharp/pull/108
2012-02-03 12:46:50 +01:00
nulltoken
5663e61a06 repository: add minimal reinitialization of repository
This currently only ensures that the version of the repository format isn't greater than zero.
2012-01-25 23:05:06 +01:00
nulltoken
9b84447a80 clay: migrate a test initializing a repository which path escapes the current working directory
A non migrated yet test has been removed as well as it's mostly redundant.
2012-01-25 23:02:08 +01:00
Vicent Martí
3fd1520cd4 Rename the Clay test suite to Clar
Clay is the name of a programming language on the makings, and we want
to avoid confusions. Sorry for the huge diff!
2012-01-24 20:35:15 -08:00