]> git.proxmox.com Git - libgit2.git/commit - src/odb.h
repository: Change ownership semantics
authorVicent Marti <tanoku@gmail.com>
Fri, 25 Nov 2011 07:16:26 +0000 (08:16 +0100)
committerVicent Marti <tanoku@gmail.com>
Sat, 26 Nov 2011 07:37:08 +0000 (08:37 +0100)
commit9462c471435b4de74848408bebe41d770dc49a50
treeaac5e696d1b3e7b4cba64082b28255e5c4593b66
parent880b6f0c22153db164ecb3a18c362ba8337365d3
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.
48 files changed:
include/git2/odb.h
include/git2/remote.h
include/git2/repository.h
src/blob.c
src/commit.c
src/common.h
src/config.c
src/config.h
src/config_file.c
src/fetch.c
src/index.c
src/index.h
src/object.c
src/odb.c
src/odb.h
src/refs.c
src/remote.c
src/repository.c
src/repository.h
src/revwalk.c
src/status.c
src/tag.c
src/tree.c
src/util.h
tests-clay/clay.h
tests-clay/clay_main.c
tests-clay/config/add.c [new file with mode: 0644]
tests-clay/config/read.c [new file with mode: 0644]
tests-clay/config/stress.c
tests-clay/config/write.c [new file with mode: 0644]
tests-clay/network/remotes.c
tests-clay/object/tree/frompath.c
tests-clay/odb/loose.c [new file with mode: 0644]
tests-clay/odb/loose_data.h [new file with mode: 0644]
tests-clay/odb/pack_data.h [new file with mode: 0644]
tests-clay/odb/packed.c [new file with mode: 0644]
tests-clay/odb/sorting.c [new file with mode: 0644]
tests-clay/repo/getters.c [new file with mode: 0644]
tests-clay/repo/init.c [new file with mode: 0644]
tests-clay/repo/open.c [new file with mode: 0644]
tests/t02-data.h [deleted file]
tests/t02-objread.c [deleted file]
tests/t02-oids.h [deleted file]
tests/t03-objwrite.c
tests/t12-repo.c
tests/t15-config.c [deleted file]
tests/t16-remotes.c [deleted file]
tests/test_main.c