summaryrefslogtreecommitdiff
path: root/src/repository.c
Commit message (Collapse)AuthorAgeFilesLines
* Fixed invalid error handling in git_repository_open_ext()Pierre-Olivier Latour2015-06-231-1/+1
|
* repository: check the format versioncmn/repo-version-checkCarlos Martín Nieto2015-06-231-9/+26
| | | | | | | | This is something we do on re-init but not when opening a repository. This hasn't particularly mattered up to now as the version has been 0 ever since the first release of git, but the times, they're a-changing and we will soon see version 1 in the wild. We need to make sure we don't open those.
* repository: don't error out if there is no versionCarlos Martín Nieto2015-06-231-2/+7
| | | | | git will assume the repository format version is 0 if the value is not there. Do the same.
* Merge pull request #3030 from linquize/symlink_supportedEdward Thomson2015-04-101-3/+5
|\ | | | | If work_dir is not specified, use repo_dir to test if symlink is supported
| * For bare repository, use repo_dir to test if symlinks are supportedLinquize2015-04-041-3/+5
| |
* | squash some leaksEdward Thomson2015-03-241-0/+2
|/
* Merge remote-tracking branch 'ethomson/submodule_8dot3'Carlos Martín Nieto2015-03-181-26/+121
|\
| * repository: Introduce "reserved names"Edward Thomson2015-02-271-26/+121
| | | | | | | | | | | | | | A repository can have multiple "reserved names" now, not just a single "short name" for the repository folder itself. Refactor to include a git_repository__reserved_names that returns all the reserved names for a repository.
* | Add annotated commit versions of reflog-modifying functionsCarlos Martín Nieto2015-03-161-6/+24
| | | | | | | | | | | | | | We do not always want to put the id directly into the reflog, but we want to speicfy what a user typed. For this use-case we provide annotated version of a few functions which let the caller specify what user-friendly name was used when asking for the operation.
* | repository: in-memory repos are bare by defaultEdward Thomson2015-03-101-1/+7
| |
* | Plug a few leaksCarlos Martín Nieto2015-03-041-0/+3
| |
* | config: borrow refcounted referencescmn/config-borrow-entryCarlos Martín Nieto2015-03-031-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the get_entry() method to return a refcounted version of the config entry, which you have to free when you're done. This allows us to avoid freeing the memory in which the entry is stored on a refresh, which may happen at any time for a live config. For this reason, get_string() has been forbidden on live configs and a new function get_string_buf() has been added, which stores the string in a git_buf which the user then owns. The functions which parse the string value takea advantage of the borrowing to parse safely and then release the entry.
* | repository: remove log message override for switching the active branchCarlos Martín Nieto2015-03-031-26/+60
| | | | | | | | | | | | We want to use the "checkout: moving from ..." message in order to let git know when a change of branch has happened. Make the convenience functions for this goal write this message.
* | Remove the signature from ref-modifying functionsCarlos Martín Nieto2015-03-031-8/+38
|/ | | | | | | | | | The signature for the reflog is not something which changes dynamically. Almost all uses will be NULL, since we want for the repository's default identity to be used, making it noise. In order to allow for changing the identity, we instead provide git_repository_set_ident() and git_repository_ident() which allow a user to override the choice of signature.
* git_filter_opt_t -> git_filter_flag_tEdward Thomson2015-02-191-1/+1
| | | | | For consistency with the rest of the library, where an opt is an options *structure*.
* repository: parse init.templatedir as a pathcmn/template-pathCarlos Martín Nieto2015-02-061-1/+2
| | | | | This is a path so we must use the path getter so we get the tilde expansion done.
* win32: cleanup 8.3 disabled testsEdward Thomson2015-02-031-1/+2
|
* Fix test failures when 8.3 is disabledLinquize2015-01-311-1/+1
|
* Merge pull request #2837 from swisspol/set_indexEdward Thomson2015-01-261-1/+1
|\ | | | | Allow passing a NULL index to git_repository_set_index()
| * Allow passing a NULL index to git_repository_set_index()Pierre-Olivier Latour2015-01-231-1/+1
| | | | | | | | | | | | This is supported by the underlying set_index() implementation and setting the repository index to NULL is recommended by the git_repository_set_bare() documentation.
* | Fixed git_repository_set_bare() not setting "core.bare" correctlyPierre-Olivier Latour2015-01-231-1/+1
|/
* Remove logically dead code (we're already asserting)Jacques Germishuys2015-01-201-1/+1
|
* Check the result of git_buf_joinpathJacques Germishuys2014-12-301-3/+7
|
* checkout: disallow bad paths on win32Edward Thomson2014-12-161-0/+25
| | | | | | | | | | | | | | | Disallow: 1. paths with trailing dot 2. paths with trailing space 3. paths with trailing colon 4. paths that are 8.3 short names of .git folders ("GIT~1") 5. paths that are reserved path names (COM1, LPT1, etc). 6. paths with reserved DOS characters (colons, asterisks, etc) These paths would (without \\?\ syntax) be elided to other paths - for example, ".git." would be written as ".git". As a result, writing these paths literally (using \\?\ syntax) makes them hard to operate with from the shell, Windows Explorer or other tools. Disallow these.
* Introduce git_rebase to set up a rebase sessionEdward Thomson2014-10-261-0/+22
| | | | | | Introduce `git_rebase` to set up a rebase session that can then be continued. Immediately, only merge-type rebase is supported.
* repository_head_unborn: clear error when HEAD is unbornEdward Thomson2014-10-031-1/+3
|
* repository: Do not double-free configvmg/walk-up-pathThe rugged tests are fragile2014-09-171-8/+8
|
* Fix attribute lookup in index for bare reposrb/attr-with-bareRussell Belfer2014-09-151-0/+26
| | | | | | | | | | | | | | | | When using a bare repo with an index, libgit2 attempts to read files from the index. It caches those files based on the path to the file, specifically the path to the directory that contains the file. If there is no working directory, we use `git_path_dirname_r` to get the path to the containing directory. However, for the `.gitattributes` file in the root of the repository, this ends up normalizing the containing path to `"."` instead of the empty string and the lookup the `.gitattributes` data fails. This adds a test of attribute lookups on bare repos and also fixes the problem by simply rewriting `"."` to be `""`.
* Introduce option to use relative paths for repository work directoryjamill/relative_gitlinkJameson Miller2014-09-021-8/+24
| | | | | | | Teach git_repository_init_ext to use relative paths for the gitlink to the work directory. This is used when creating a sub repository where the sub repository resides in the parent repository's .git directory.
* git_cherry_pick -> git_cherrypickEdward Thomson2014-07-221-3/+3
|
* Address style concerns in setting mkdir/copy flags.Edward Lee2014-05-231-16/+10
|
* Fixed permissions on template directories.Edward Lee2014-05-161-7/+21
|
* Increase use of config snapshotsrb/coverity-fixesRussell Belfer2014-05-131-12/+12
| | | | And decrease extra reload checks of config data.
* Merge pull request #2336 from libgit2/rb/unicode-branch-namesRussell Belfer2014-05-121-55/+2
|\ | | | | Pass unconverted Unicode path data when iconv doesn't like it
| * Pass unconverted data when iconv doesn't like itRussell Belfer2014-05-081-55/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When using Iconv to convert unicode data and iconv doesn't like the source data (because it thinks that it's not actual UTF-8), instead of stopping the operation, just use the unconverted data. This will generally do the right thing on the filesystem, since that is the source of the non-UTF-8 path data anyhow. This adds some tests for creating and looking up branches with messy Unicode names. Also, this takes the helper function that was previously internal to `git_repository_init` and makes it into `git_path_does_fs_decompose_unicode` which is a useful in tests to understand what the expected results should be.
* | Minor fixes for warnings and error propagationRussell Belfer2014-05-121-2/+3
| |
* | Merge pull request #2188 from libgit2/cmn/config-snapshotRussell Belfer2014-05-121-12/+20
|\ \ | | | | | | Configuration snapshotting
| * | repository: introduce a convenience config snapshot methodcmn/config-snapshotCarlos Martín Nieto2014-05-071-5/+12
| | | | | | | | | | | | | | | | | | Accessing the repository's config and immediately taking a snapshot of it is a common operation, so let's provide a convenience function for it.
| * | Use config snapshottingCarlos Martín Nieto2014-04-181-12/+13
| | | | | | | | | | | | | | | This way we can assume we have a consistent view of the config situation when we're looking up remote, branch, pack-objects, etc.
* | | Add filter options and ALLOW_UNSAFERussell Belfer2014-05-061-1/+2
| |/ |/| | | | | | | | | | | | | | | Diff and status do not want core.safecrlf to actually raise an error regardless of the setting, so this extends the filter API with an additional options flags parameter and adds a flag so that filters can be applied with GIT_FILTER_OPT_ALLOW_UNSAFE, indicating that unsafe filter application should be downgraded from a failure to a warning.
* | Make init_options fns use unsigned ints and macroRussell Belfer2014-05-021-9/+6
| | | | | | | | | | Use an unsigned int for the version and add a helper macro so the code is simplified (and so the error message is a common string).
* | Win32: UTF-8 <-> WCHAR conversion overhaulPhilip Kelley2014-04-191-3/+7
|/
* Rewrite `git_repository__cleanup_files`vmg/state-cleanupVicent Marti2014-04-091-14/+20
|
* git_repository_state_cleanup() should remove rebase-merge/, rebase-apply/ ↵Jacques Germishuys2014-04-071-1/+6
| | | | and BISECT_LOG
* Make a real submodule cache objectRussell Belfer2014-04-011-1/+1
| | | | | | | This takes the old submodule cache which was just a git_strmap and makes a real git_submodule_cache object that can contain other things like a lock and timestamp-ish data to control refreshing of submodule info.
* Added function-based initializers for every options struct.Matthew Bowen2014-03-051-0/+12
| | | | The basic structure of each function is courtesy of arrbee.
* Merge pull request #2138 from ethomson/sysdirVicent Marti2014-02-251-1/+2
|\ | | | | Move system directory cache out of utils
| * Move system directory cache out of utilsEdward Thomson2014-02-241-1/+2
| |
* | Remove now-duplicated stdarg.h includeEdward Thomson2014-02-241-1/+0
|/
* ReadabilityBen Straub2014-02-181-1/+3
|