| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following files now have 0444 permissions:
- loose objects
- pack indexes
- pack files
- packs downloaded by fetch
- packs downloaded by the HTTP transport
And the following files now have 0666 permissions:
- config files
- repository indexes
- reflogs
- refs
This brings libgit2 more in line with Git.
Note that git_filebuf_commit() and git_filebuf_commit_at() have both
gained a new mode parameter.
The latter change fixes an important issue where filebufs created with
GIT_FILEBUF_TEMPORARY received 0600 permissions (due to mkstemp(3)
usage). Now we chmod() the file before renaming it into place.
Tests have been added to confirm that new commit, tag, and tree
objects are created with the right permissions. I don't have access to
Windows, so for now I've guarded the tests with "#ifndef GIT_WIN32".
|
|
|
|
|
|
|
|
| |
The documentation is a bit misleading. The subsection name is always
case-sensitive, but with a [section.subsection] header, the subsection
is transformed to lowercase when the configuration is parsed.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
git_repository_config wants to take the global and system paths again
so that one can be explicit if needed.
The git_repository_config_autoload function is provided for the cases
when it's good enough for the library to guess where those files are
located.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
|
|
| |
This reverts commit e1b86444676b70154bf8ab450d429bdef57a8276.
|
|
|
|
|
|
|
|
| |
wide values
Should fix issue #419.
Signed-off-by: nulltoken <emeric.fermas@gmail.com>
|
| |
|
| |
|
|
|
|
|
|
| |
If the global configuration file is missing, it is ignored.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
|
|
|
|
|
| |
There is no need in STRLEN macros. Compilers can do this trivial
optimization on its own.
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
|
| |
|
|
|
|
|
|
|
|
| |
Removing a section variable doesn't remove its section
header. Overwrite the config10 file so there are no changes after the
test is run.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
|
|
| |
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
|
|
| |
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
|
|
| |
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
| |
|
| |
|
|
|
|
|
| |
Do not mess with environment variables anymore. The new external API has
more helper methods, and everything is explicit.
|
|
|
|
|
|
|
| |
If a config has several files, we need to check all of them before we
can say that a variable doesn't exist.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
|
|
|
|
| |
The repo's configuration should take precedence over the global one.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
|
|
|
|
| |
Add a test to check that value replacement works.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
|
|
| |
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
|
|
| |
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
|
|
| |
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
|
|
|
|
|
|
| |
"git_config_backend" have been renamed to "git_config_file", which
implements a generic interface to access a configuration file -- be it
either on disk, from a DB or whatever mumbojumbo.
I think this makes more sense.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Configuration options can come from different sources. Currently,
there is only support for reading them from a flat file, but it might
make sense to read it from a database at some point.
Move the parsing code into src/config_file.c and create an include
file include/git2/config_backend.h to allow for other backends to be
developed.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
|
|
| |
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
|
|
| |
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|
|