summaryrefslogtreecommitdiff
path: root/include/git2/repository.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix warnings and merge issues on Win64Russell Belfer2012-08-231-0/+5
|
* Add template dir and set gid to repo initRussell Belfer2012-08-221-17/+30
| | | | | | | | | | | | | | | | | This extends git_repository_init_ext further with support for initializing the repository from an external template directory and with support for the "create shared" type flags that make a set GID repository directory. This also adds tests for much of the new functionality to the existing `repo/init.c` test suite. Also, this adds a bunch of new utility functions including a very general purpose `git_futils_mkdir` (with the ability to make paths and to chmod the paths post-creation) and a file tree copying function `git_futils_cp_r`. Also, this includes some new path functions that were useful to keep the code simple.
* Add git_repository_init_ext for power inittersRussell Belfer2012-08-221-4/+131
| | | | | | | The extended version of repository init adds support for many of the things that you can do with `git init` and sets up structures that will make it easier to extend further in the future.
* repository: add a getter and remove function for git's prepared messageCarlos Martín Nieto2012-08-011-0/+22
| | | | | | | | | | The 'git revert/cherry-pick/merge -n' commands leave .git/MERGE_MSG behind so that git-commit can find it. As we don't yet support these operations, users who are shelling out to let git perform these operations haven't had a convenient way to get this message. These functions allow the user to retrieve the message and remove it when she's created the commit.
* repo: add git_repository_wrap_odb() to wrap an ODBCarlos Martín Nieto2012-07-211-0/+13
| | | | Primarily useful when used together with git_odb_backend_one_pack().
* Add flag to write gitlink on setting repo workdirRussell Belfer2012-07-101-1/+4
| | | | | | | | | | | | | | | | | | | | This added a flag to the `git_repository_set_workdir()` function that enables generation of a `.git` gitlink file that links the new workdir to the parent repository. Essentially, the flag tells the function to write out the changes to disk to permanently set the workdir of the repository to the new path. If you pass this flag as true, then setting the workdir to something other than the default workdir (i.e. the parent of the .git repo directory), will create a plain file named ".git" with the standard gitlink contents "gitdir: <repo-path>", and also update the "core.worktree" and "core.bare" config values. Setting the workdir to the default repo workdir will clear the core.worktree flag (but still permanently set core.bare to false). BTW, the libgit2 API does not currently provide a function for clearing the workdir and converting a non-bare repo into a bare one.
* Fix spelling errors.Bruce Mitchener2012-05-191-2/+2
|
* errors: Rename the generic return codesVicent Martí2012-05-181-7/+7
|
* Refactor git_repository_open with new optionsRussell Belfer2012-04-111-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Update Copyright headerschu2012-02-131-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* Document all of the thingsVicent Marti2011-11-261-1/+119
|
* Rename all `_close` methodsVicent Marti2011-11-261-1/+1
| | | | | There's no difference between `_free` and `_close` semantics: keep everything with the same name to avoid confusions.
* repository: Change ownership semanticsVicent Marti2011-11-261-197/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix typo in repository documentationHaitao Li2011-11-181-1/+1
|
* repository: export git_repository_config_autoloadCarlos Martín Nieto2011-09-301-2/+3
| | | | | | Take the opportunity to finish the comment about this function. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Make repo config loading automatic or completely explicitCarlos Martín Nieto2011-09-271-10/+24
| | | | | | | | | | | 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>
* Merge pull request #398 from carlosmn/config-autohomeVicent Martí2011-09-181-12/+7
|\ | | | | git_repository_config: open global config file automatically
| * git_repository_config: open global config file automaticallyCarlos Martín Nieto2011-09-121-12/+7
| | | | | | | | | | | | If the global configuration file is missing, it is ignored. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* | Cleanup legal dataVicent Marti2011-09-191-22/+4
| | | | | | | | | | | | | | | | | | | | 1. The license header is technically not valid if it doesn't have a copyright signature. 2. The COPYING file has been updated with the different licenses used in the project. 3. The full GPLv2 header in each file annoys me.
* | repository: Add git_repository_head()nulltoken2011-09-151-0/+10
| |
* | Standardized doxygen @return lines for int functions to say "GIT_SUCCESS or ↵David Boyce2011-09-131-6/+6
|/ | | | an error code".
* cleanup: remove trailing spacesKirill A. Shutemov2011-07-011-4/+4
| | | | Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* repository: Make head_detached() and head_orphan() convenience methods ↵nulltoken2011-06-301-2/+2
| | | | accessible to bindings
* repo: Rename HEAD-related methodsVicent Marti2011-06-281-2/+2
|
* Add git_repository_is_detached, git_repository_is_orphanCarlos Martín Nieto2011-06-281-0/+24
| | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* config: Cleanup external APIVicent Marti2011-06-181-2/+30
| | | | | Do not mess with environment variables anymore. The new external API has more helper methods, and everything is explicit.
* Add git_repository_config APICarlos Martín Nieto2011-06-171-0/+10
| | | | | | | This function puts the global and repository configurations in one git_config object and gives it to the user. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* Merge pull request #261 from Romain-Geissler/discovery-path-v2Vicent Martí2011-06-151-3/+3
|\ | | | | Fix: GIT_PATH_PATH_SEPARATOR is now a semi-colon under Windows.
| * Fix: GIT_PATH_PATH_SEPARATOR is now a semi-colon under Windows.Romain Geissler2011-06-151-3/+3
| | | | | | | | | | GIT_PATH_LIST_SEPARATOR and GIT_PATH_MAX are made public so that it's can be used by a client.
* | repository: Export all internal pathsVicent Marti2011-06-041-9/+18
|/
* Repository: Added the git_repository_discover function that finds by itself ↵Romain Geissler2011-06-041-0/+28
| | | | the git directory that manage a given directory path.
* Merge pull request #206 from nulltoken/topic/is-bareVicent Martí2011-06-011-0/+8
|\ | | | | Add git_repository_is_bare() accessor
| * Add git_repository_is_bare() accessornulltoken2011-05-241-0/+8
| |
* | index: Change the memory management for repo indexesVicent Marti2011-06-011-3/+11
|/ | | | | The `git_repository_index` call now returns a brand new index that must be manually free'd.
* Add two new accessors to the repositorynulltoken2011-04-091-0/+18
| | | | git_repository_path() and git_repository_workdir() respectively return the path to the git repository and the working directory. Those paths are absolute and normalized.
* Add new method `git_repository_is_empty`Vicent Marti2011-04-081-0/+12
|
* Remove `git_repository_gc` from the headersVicent Marti2011-03-231-10/+6
|
* Fix signature in `git_repository_gc`Vicent Marti2011-03-161-1/+1
| | | | The method returns an int with the amount of objects free'd
* Export `git_repository_gc` properlyVicent Marti2011-03-161-1/+1
| | | | | One of my brainfarts made me export it as `git_repository_close` instead of GC. Duh.
* Fix the retarded object interdependency systemVicent Marti2011-03-141-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's no longer retarded. All object interdependencies are stored as OIDs instead of actual objects. This should be hundreds of times faster, specially on big repositories. Heck, who knows, maye it doesn't even segfault -- wouldn't that be awesome? What has changed on the API? `git_commit_parent`, `git_commit_tree`, `git_tag_target` now return their values through a pointer-to-pointer, and have an error code. `git_commit_set_tree` and `git_tag_set_target` now return an error code and may fail. `git_repository_free__no_gc` has been deprecated because it's stupid. Since there are no longer any interdependencies between objects, we don't need internal reference counting, and GC never fails or double-free's pointers. `git_object_close` now does a very sane thing: marks an object as unused. Closed objects will be eventually free'd from the object cache based on LRU. Please use `git_object_close` from the garbage collector `destroy` method on your bindings. It's 100% safe. `git_repository_gc` is a new method that forces a garbage collector pass through the repo, to free as many LRU objects as possible. This is useful if we are running out of memory.
* Move the external includes folder from `src` to `include`Vicent Marti2011-03-031-0/+183
Signed-off-by: Vicent Marti <tanoku@gmail.com>