Commit Graph

10 Commits

Author SHA1 Message Date
nulltoken
3191ae89c6 compat: make p_open able to accept optional mode when passing the O_CREAT flag
This has the nice side effect of making test_attr_repo__staging_properly_normalizes_line_endings_according_to_gitattributes_directives() test pass again on Windows. This test started to fail after commit 674a198 was applied.
2012-05-07 12:18:54 +02:00
Vicent Martí
674a198599 clar: Properly create files in helper 2012-05-04 16:05:14 -07:00
Vicent Martí
76873c0905 Silence return value warning 2012-05-03 13:30:14 -07:00
Russell Belfer
17f1c9fb33 chmod for writability when writing test files 2012-05-02 16:44:47 -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
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
Vicent Martí
bbb3723657 clar: Properly create file in helper 2012-04-04 01:31:29 +02:00
Russell Belfer
854eccbb2d Clean up GIT_UNUSED macros on all platforms
It turns out that commit 31e9cfc4cbcaf1b38cdd3dbe3282a8f57e5366a5
did not fix the GIT_USUSED behavior on all platforms.  This commit
walks through and really cleans things up more thoroughly, getting
rid of the unnecessary stuff.

To remove the use of some GIT_UNUSED, I ended up adding a couple
of new iterators for hashtables that allow you to iterator just
over keys or just over values.

In making this change, I found a bug in the clar tests (where we
were doing *count++ but meant to do (*count)++ to increment the
value).  I fixed that but then found the test failing because it
was not really using an empty repo.  So, I took some of the code
that I wrote for iterator testing and moved it to clar_helpers.c,
then made use of that to make it easier to open fixtures on a
per test basis even within a single test file.
2012-03-02 15:51:55 -08:00
Russell Belfer
ce49c7a8a9 Add filter tests and fix some bugs
This adds some initial unit tests for file filtering and fixes
some simple bugs in filter application.
2012-03-02 15:09:40 -08: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