Commit Graph

28 Commits

Author SHA1 Message Date
nulltoken
2017a15d6c path: add git_path_fromurl() 2011-12-28 20:35:09 +01:00
nulltoken
459e2dcd7d path: add git__percent_decode() 2011-12-28 20:31:11 +01:00
nulltoken
eb8de7476b util: add git__fromhex() 2011-12-28 20:25:29 +01:00
Vicent Martí
fa51565625 refs: Fix double free
Includes relevant Clay test
2011-12-25 00:22:20 +01:00
nulltoken
db1f7e596c remote: add test to retrieve the advertised references from a local repository and fix related implementation 2011-12-21 21:30:12 +01:00
Vicent Marti
bc57b80b83 Update to Clay 0.10.0
Comes with support for global events; this fixes #496.
2011-12-15 02:09:15 +01:00
Russell Belfer
b5daae68a4 Allow git_buf_joinpath to accept self-joins
It was not safe for git_buf_joinpath to be used with a pointer
into the buf itself because a reallocation could invalidate
the input parameter that pointed into the buffer.  This patch
makes it safe to self join, at least for the leading input to
the join, which is the common "append" case for self joins.

Also added unit tests to explicitly cover this case.

This should actually fix #511
2011-12-14 14:31:06 -08:00
nulltoken
8fae76c5e5 commit: add test to ensure predictability of generation of commit, tree and blob object ids 2011-12-14 13:16:56 +01:00
Vicent Marti
16a9f32abd Merge remote-tracking branch 'nulltoken/topic/oid-generation' into development
Conflicts:
	tests-clay/clay.h
	tests-clay/clay_main.c
2011-12-14 03:32:49 +01:00
Vicent Marti
40e73d6f88 Merge remote-tracking branch 'arrbee/git-buf-for-paths' into development
Conflicts:
	tests-clay/clay_main.c
2011-12-09 01:38:46 +01:00
Russell Belfer
97769280ba Use git_buf for path storage instead of stack-based buffers
This converts virtually all of the places that allocate GIT_PATH_MAX
buffers on the stack for manipulating paths to use git_buf objects
instead.  The patch is pretty careful not to touch the public API
for libgit2, so there are a few places that still use GIT_PATH_MAX.

This extends and changes some details of the git_buf implementation
to add a couple of extra functions and to make error handling easier.

This includes serious alterations to all the path.c functions, and
several of the fileops.c ones, too.  Also, there are a number of new
functions that parallel existing ones except that use a git_buf
instead of a stack-based buffer (such as git_config_find_global_r
that exists alongsize git_config_find_global).

This also modifies the win32 version of p_realpath to allocate whatever
buffer size is needed to accommodate the realpath instead of hardcoding
a GIT_PATH_MAX limit, but that change needs to be tested still.
2011-12-07 23:08:15 -08:00
nulltoken
a7954d2a5a tree: add test to ensure predictability of generation of object ids 2011-12-04 18:12:40 +01:00
Carlos Martín Nieto
b4d757c0a8 clay: add tests for tree diff'ing
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Signed-off-by: Vicent Marti <tanoku@gmail.com>
2011-12-03 18:06:27 +01:00
Russell Belfer
969d588d9a Optimized of git_buf_join.
This streamlines git_buf_join and removes the join-append behavior,
opting instead for a very compact join-replace of the git_buf contents.
The unit tests had to be updated to remove the join-append tests and
have a bunch more exhaustive tests added.
2011-11-30 13:10:47 -08:00
Vicent Marti
8e46168cd9 clay: Add buffer tests 2011-11-29 11:36:18 +01:00
Vicent Marti
9462c47143 repository: Change ownership semantics
The ownership semantics have been changed all over the library to be
consistent. There are no more "borrowed" or duplicated references.

Main changes:

	- `git_repository_open2` and `3` have been dropped.

	- Added setters and getters to hotswap all the repository owned
	objects:

		`git_repository_index`
		`git_repository_set_index`
		`git_repository_odb`
		`git_repository_set_odb`
		`git_repository_config`
		`git_repository_set_config`
		`git_repository_workdir`
		`git_repository_set_workdir`

	Now working directories/index files/ODBs and so on can be
	hot-swapped after creating a repository and between operations.

	- All these objects now have proper ownership semantics with
	refcounting: they all require freeing after they are no longer
	needed (the repository always keeps its internal reference).

	- Repository open and initialization has been updated to keep in
	mind the configuration files. Bare repositories are now always
	detected, and a default config file is created on init.

	- All the tests affected by these changes have been dropped from the
	old test suite and ported to the new one.
2011-11-26 08:37:08 +01:00
Carlos Martín Nieto
533fda3b83 config: test saving config to new file 2011-11-26 02:00:18 +01:00
Russell Belfer
b762e576c6 filebuf: add GIT_FILEBUF_INIT and protect multiple opens and cleanups
Update all stack allocations of git_filebuf to use GIT_FILEBUF_INIT
and make git_filebuf_open and git_filebuf_cleanup safe to be called
multiple times on the same buffer.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2011-11-22 01:53:56 +01:00
Vicent Marti
1d09a1c88d clay: Merge manually @leto's tests from #485
This uses the new Clay code. As you can see, the diff is minimal... It
works!
2011-11-22 01:41:22 +01:00
Carlos Martín Nieto
c515b5bf1e Add test for renaming a file and adding it to the index
Thanks to Emeric.
2011-11-18 02:35:45 +01:00
Vicent Marti
d1a721c595 clay: Bump to 0.9.0, add TAP support
Comes with schu's stress tests for config files. Hopefully the diffs
will stay minimal from now on.
2011-11-18 01:40:35 +01:00
schu
9ff46db911 tests-clay: move t01-rawobj.c to clay
Signed-off-by: schu <schu-github@schulog.org>
2011-10-24 23:51:28 +02:00
nulltoken
3fa735ca3b tree: Add git_tree_frompath() which, given a relative path to a tree entry, retrieves the tree object containing this tree entry 2011-10-13 23:30:07 +02:00
nulltoken
34aff01002 oid: Add git_oid_streq() which checks if an oid and an hex formatted string are equal 2011-10-13 23:15:11 +02:00
schu
681008c768 tests-clay: update clay
The clay script didn't match the latest version from upstream.
Additionaly, add core/strtol.c to complete porting the core tests to
clay.

Signed-off-by: schu <schu-github@schulog.org>
2011-10-07 23:02:02 +02:00
Vicent Marti
d02a7d8330 Update Clay 2011-09-28 18:57:32 +02:00
Vicent Marti
11385c3c4b Add sample "Status" clay tests 2011-09-16 05:13:44 +02:00
Vicent Marti
f1558d9bca Come out and Clay 2011-09-15 01:12:46 +02:00