summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Fix git_repository_set_index() refcount issuenulltoken2012-04-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | git_repository_free() calls git_index_free() if the owned index is not null. According to the doc, when setting a new index through git_repository_set_index() the caller has still to take care of releasing the index by itself. In order to cope with this, this fix makes sure the index refcount is incremented when a new repository is being plugged a new index.
* | | config: parse quoted valuesCarlos Martín Nieto2012-04-161-21/+85
| | | | | | | | | | | | | | | Variable values may be quoted to include newlines, literal quotes and other characters. Add support for these and test it.
* | | repo: plug a couple of leaksCarlos Martín Nieto2012-04-141-0/+3
|/ /
* | Add support for pathspec to diff and statusRussell Belfer2012-04-136-5/+128
| | | | | | | | | | | | | | This adds preliminary support for pathspecs to diff and status. The implementation is not very optimized (it still looks at every single file and evaluated the the pathspec match against them), but it works.
* | Merge remote-tracking branch 'carlosmn/revwalk-merge-base' into ↵Vicent Martí2012-04-131-118/+318
|\ \ | | | | | | | | | new-error-handling
| * | error-handling: revwalkCarlos Martín Nieto2012-04-121-100/+104
| | |
| * | Move git_merge_base() to is own header and document itCarlos Martín Nieto2012-04-121-0/+1
| | |
| * | revwalk: use a priority queue for calculating merge basesCarlos Martín Nieto2012-04-121-37/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | As parents are older than their children, we're appending to the commit list most of the time, which makes an ordered linked list quite inefficient. While we're there, don't sort the results list in the main loop, as we're sorting them afterwards and it creates extra work.
| * | revwalk: use merge bases to speed up processingCarlos Martín Nieto2012-04-121-2/+39
| | | | | | | | | | | | | | | | | | | | | There is no need walk down the parents of a merge base to mark them as uninteresting because we'll never see them. Calculate the merge bases in prepare_walk() so mark_uninteresting() can stop at a merge base instead of walking all the way to the root.
| * | Implement git_merge_base()Carlos Martín Nieto2012-04-121-9/+167
| | | | | | | | | | | | | | | | | | It's implemented in revwalk.c so it has access to the revision walker's commit cache and related functions. The algorithm is the one used by git, modified so it fits better with the library's functions.
| * | revwalk: allow pushing/hiding a reference by nameCarlos Martín Nieto2012-04-121-38/+33
| | | | | | | | | | | | | | | | | | The code was already there, so factor it out and let users push an OID by giving it a reference name. Only refs to commits are supported. Annotated tags will throw an error.
| * | revwalk: don't assume malloc succeedsCarlos Martín Nieto2012-04-121-3/+9
| | |
* | | Merge pull request #623 from arrbee/refactor-openVicent Martí2012-04-136-323/+301
|\ \ \ | |_|/ |/| | Update git_repository_open
| * | Refactor git_repository_open with new optionsRussell Belfer2012-04-116-323/+301
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | branch: simplify error handling for git_branch_move()Carlos Martín Nieto2012-04-121-18/+10
| | | | | | | | | | The cleanup needs to happen anyway, so set the error code and jump there instead of copying the code.
* | local transport: plug leakCarlos Martín Nieto2012-04-121-0/+1
| |
* | branch: plug leaks in git_branch_move() and _delete()Carlos Martín Nieto2012-04-121-14/+32
|/
* status: Remove status_oldVicent Martí2012-04-111-82/+0
| | | | This is Git yo. You can fetch stuff from the history if you need it.
* error-handling local transportCarlos Martín Nieto2012-04-111-80/+66
|
* error-handling: fetchCarlos Martín Nieto2012-04-111-44/+39
|
* netops: show winsock error messages on WindowsCarlos Martín Nieto2012-04-111-3/+23
|
* error-handling: netopsCarlos Martín Nieto2012-04-111-31/+29
|
* error-handling: httpCarlos Martín Nieto2012-04-111-165/+120
|
* error-handling: git transportCarlos Martín Nieto2012-04-111-134/+127
|
* error-handling: protocol, pktCarlos Martín Nieto2012-04-112-76/+60
|
* error-handling: remote, transportCarlos Martín Nieto2012-04-112-149/+105
|
* Fix compilation errors and warningsnulltoken2012-04-111-9/+4
|
* Typedefs don't have enum in frontCarlos Martín Nieto2012-04-113-4/+4
|
* Merge pull request #619 from nulltoken/topic/branchesVicent Martí2012-04-117-9/+284
|\ | | | | Basic branch management API
| * branch: add git_branch_move()nulltoken2012-04-102-0/+27
| |
| * fileops: Make git_futils_mkdir_r() able to skip non-empty directoriesnulltoken2012-04-102-7/+33
| |
| * Add basic branch management API: git_branch_create(), git_branch_delete(), ↵nulltoken2012-04-102-0/+197
| | | | | | | | git_branch_list()
| * transport/local: Fix peeling of nested tagsnulltoken2012-04-101-2/+7
| |
| * tag: Add git_tag_peel() which recursively peel a tag until a non tag ↵nulltoken2012-04-101-0/+20
| | | | | | | | git_object is met
* | repository: make git_repository_set_workdir() prettify the path it is being ↵nulltoken2012-04-111-3/+6
| | | | | | | | passed
* | Merge branch 'new-error-handling' of github.com:libgit2/libgit2 into ↵Vicent Martí2012-04-1122-139/+934
|\ \ | | | | | | | | | new-error-handling
| * | Clean up valgrind warningsCarlos Martín Nieto2012-04-044-2/+6
| |/
| * reference: Fix creation of references with extended ASCII characters in ↵nulltoken2012-04-011-1/+12
| | | | | | | | their name
| * Fix bug when join_n refers to original bufferRussell Belfer2012-03-301-6/+18
| | | | | | | | | | | | There was a bug in git_buf_join_n when the contents of the original buffer were joined into itself and the realloc moved the pointer to the original buffer.
| * Improve config handling for diff,submodules,attrsRussell Belfer2012-03-3011-125/+211
| | | | | | | | | | | | | | | | This adds support for a bunch of core.* settings that affect diff and status, plus fixes up some incorrect implementations of those settings from before. Also, this cleans up the handling of config settings in the new submodules code and in the old attrs/ignore code.
| * Added submodule API and use in statusRussell Belfer2012-03-288-11/+452
| | | | | | | | | | | | | | | | | | | | When processing status for a newly checked out repo, it is possible that there will be submodules that have not yet been initialized. The only way to distinguish these from untracked directories is to have some knowledge of submodules. This commit adds a new submodule API which, given a name or path, can determine if it appears to be a submodule and can give information about the submodule.
| * Fix handling of submodules in treesRussell Belfer2012-03-261-1/+1
| |
| * Eliminate hairy COITERATE macroRussell Belfer2012-03-253-38/+53
| | | | | | | | | | | | | | I decided that the COITERATE macro was, in the end causing more confusion that it would save and decided just to write out the loops that I needed for parallel diff list iteration. It is not that much code and this just feels less obfuscated.
| * Fix error in tree iterator when popping up treesRussell Belfer2012-03-251-1/+0
| | | | | | | | | | | | | | | | | | | | There was an error in the tree iterator where it would delete two tree levels instead of just one when popping up a tree level. Unfortunately the test data for the tree iterator did not have any deep trees with subtrees in the middle of the tree items, so this problem went unnoticed. This contains the 1-line fix plus new test data and tests that reveal the issue.
| * Restore default status recursion behaviorRussell Belfer2012-03-231-1/+2
| | | | | | | | | | | | | | | | This gives `git_status_foreach()` back its old behavior of emulating the "--untracked=all" behavior of git. You can get any of the various --untracked options by passing flags to `git_status_foreach_ext()` but the basic version will keep the behavior it has always had.
| * Fix crash in new status and add recurse optionRussell Belfer2012-03-232-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the bug that @nulltoken found (thank you!) where if there were untracked directories alphabetically after the last tracked item, the diff implementation would deref a NULL pointer. The fix involved the code which decides if it is necessary to recurse into a directory in the working dir, so it was easy to add a new option `GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS` to control if the contents of untracked directories should be included in status.
| * New status fixesRussell Belfer2012-03-224-18/+52
| | | | | | | | | | | | | | This adds support for roughly-right tracking of submodules (although it does not recurse into submodules to detect internal modifications a la core git), and it adds support for including unmodified files in diff iteration if requested.
| * Reimplment git_status_foreach using git diffRussell Belfer2012-03-214-23/+206
| | | | | | | | | | This is an initial reimplementation of status using diff a la the way that core git does it.
* | error-handling: Commit (WIP)Vicent Martí2012-04-022-82/+107
|/
* Convert reflog to new errorsRussell Belfer2012-03-202-90/+83
| | | | Cleaned up some other issues.