summaryrefslogtreecommitdiff
path: root/src/submodule.c
Commit message (Collapse)AuthorAgeFilesLines
...
* update copyrightsEdward Thomson2013-01-081-1/+1
|
* Submodule caching fix and location APIRussell Belfer2013-01-041-6/+21
| | | | | | | | | | This adds a new API to the submodule interface that just returns where information about the submodule was found (e.g. config file only or in the HEAD, index, or working directory). Also, the old "refresh" call was potentially keeping some stale submodule data around, so this simplfies that code and literally discards the old cache, then reallocates.
* Fix diff constructor name order confusionRussell Belfer2012-12-171-2/+2
| | | | | | | | | | | | The diff constructor functions had some confusing names, where the "old" side of the diff was coming after the "new" side. This reverses the order in the function name to make it less confusing. Specifically... * git_diff_index_to_tree becomes git_diff_tree_to_index * git_diff_workdir_to_index becomes git_diff_index_to_workdir * git_diff_workdir_to_tree becomes git_diff_tree_to_workdir
* Clean up iterator APIsRussell Belfer2012-12-101-1/+1
| | | | | | | | This removes the need to explicitly pass the repo into iterators where the repo is implied by the other parameters. This moves the repo to be owned by the parent struct. Also, this has some iterator related updates to the internal diff API to lay the groundwork for checkout improvements.
* Deploy GIT_REPOSITORY_INIT_OPTIONS_INITBen Straub2012-11-301-2/+1
|
* Deploy GIT_DIFF_OPTIONS_INITBen Straub2012-11-301-2/+1
|
* Consolidate text buffer functionsRussell Belfer2012-11-281-1/+2
| | | | | | | | | | | | | There are many scattered functions that look into the contents of buffers to do various text manipulations (such as escaping or unescaping data, calculating text stats, guessing if content is binary, etc). This groups all those functions together into a new file and converts the code to use that. This has two enhancements to existing functionality. The old text stats function is significantly rewritten and the BOM detection code was extended (although largely we can't deal with anything other than a UTF8 BOM).
* Fix uninitialized variableSascha Cunz2012-11-281-1/+1
| | | | | | | clang-SVN HEAD kindly provided my the info, that sm_repo maybe uninitialized when we want to free it (If the expression in line 358 or 359/360 evaluate to true, we jump to "cleanup", where we'd use sm_repo uninitialized).
* API updates for index.hBen Straub2012-11-271-1/+1
|
* API updates for submodule.hRussell Belfer2012-11-271-8/+8
|
* Clean up config.hBen Straub2012-11-271-8/+8
|
* Rename ref and reflog apis for consistencyBen Straub2012-11-271-3/+3
|
* Add explicit git_index ptr to diff and checkoutRussell Belfer2012-11-141-2/+2
| | | | | | | | A number of diff APIs and the `git_checkout_index` API take a `git_repository` object an operate on the index. This updates them to take a `git_index` pointer explicitly and only fall back on the `git_repository` index if the index input is NULL. This makes it easier to operate on a temporary index.
* Add iterator for git_index objectRussell Belfer2012-11-141-1/+1
| | | | | | The index iterator could previously only be created from a repo object, but this allows creating an iterator from a `git_index` object instead (while keeping, though renaming, the old function).
* Fix diff API to better parameter orderRussell Belfer2012-11-141-2/+2
| | | | | The diff API is not in the parameter order one would expect from other libgit2 APIs. This fixes that.
* Some diff refactorings to help code reuseRussell Belfer2012-11-091-1/+1
| | | | | | | | | | | | | | | | | There are some diff functions that are useful in a rewritten checkout and this lays some groundwork for that. This contains three main things: 1. Share the function diff uses to calculate the OID for a file in the working directory (now named `git_diff__oid_for_file` 2. Add a `git_diff__paired_foreach` function to iterator over two diff lists concurrently. Convert status to use it. 3. Move all the string/prefix/index entry comparisons into function pointers inside the `git_diff_list` object so they can be switched between case sensitive and insensitive versions. This makes them easier to reuse in various functions without replicating logic. As part of this, move a couple of index functions out of diff.c and into index.c.
* index refactoringEdward Thomson2012-10-291-3/+3
|
* Add config level support in the config APIyorah2012-10-231-5/+6
| | | | | | | Added `struct git_config_entry`: a git_config_entry contains the key, the value, and the config file level from which a config element was found. Added `git_config_open_level`: build a single-level focused config object from a multi-level one. We are now storing `git_config_entry`s in the khash of the config_file
* refs: use constants for well-known namesnulltoken2012-10-071-2/+2
|
* Clean up Win64 warningsRussell Belfer2012-09-281-1/+1
|
* Initial implementation of new diff patch APIRussell Belfer2012-09-251-3/+4
| | | | | | | | Replacing the `git_iterator` object, this creates a simple API for accessing the "patch" for any file pair in a diff list and then gives indexed access to the hunks in the patch and the lines in the hunk. This is the initial implementation of this revised API - it is still broken, but at least builds cleanly.
* Add missing accessor for fetchRecurseSubmodulesRussell Belfer2012-09-071-0/+20
| | | | | | When `git_submodule` became an opaque structure, I forgot to add accessor functions for the fetchRecurseSubmodules config setting. This fixes that.
* Diff iteratorsRussell Belfer2012-09-051-0/+1
| | | | | | | | | | | This refactors the diff output code so that an iterator object can be used to traverse and generate the diffs, instead of just the `foreach()` style with callbacks. The code has been rearranged so that the two styles can still share most functions. This also replaces `GIT_REVWALKOVER` with `GIT_ITEROVER` and uses that as a common error code for marking the end of iteration when using a iterator style of object.
* Fix valgrind warnings and spurious error messagesRussell Belfer2012-08-241-0/+2
| | | | | | Just clean up valgrind warnings about uninitialized memory and also clear out errno in some cases where it results in a false error message being generated at a later point.
* Working implementation of git_submodule_statusRussell Belfer2012-08-241-191/+176
| | | | | | | | | | | | | This is a big redesign of the git_submodule_status API and the implementation of the redesigned API. It also fixes a number of bugs that I found in other parts of the submodule API while writing the tests for the status part. This also fixes a couple of bugs in the iterators that had not been noticed before - one with iterating when there is a gitlink (i.e. separate-work-dir) and one where I was treating anything even vaguely submodule-like as a submodule, more aggressively than core git does.
* Fix valgrind issues and leaksRussell Belfer2012-08-241-112/+115
| | | | | | This fixes up a number of problems flagged by valgrind and also cleans up the internal `git_submodule` allocation handling overall with a simpler model.
* Major submodule rewriteRussell Belfer2012-08-241-143/+1238
| | | | | This replaces the old submodule API with a new extended API that supports most of the things that can be done with `git submodule`.
* Isolate khash inlines from global namespaceRussell Belfer2012-07-121-3/+3
| | | | | khash.h was globally #define'ing "inline" which messes with other files. Let's keep it as "kh_inline".
* errors: Rename error codesbreaking-changesVicent Martí2012-05-181-2/+2
|
* errors: Rename the generic return codesVicent Martí2012-05-181-2/+2
|
* global: Change parameter ordering in APIVicent Martí2012-05-181-1/+4
| | | | Consistency is good.
* Rename git_khash_str to git_strmap, etc.Russell Belfer2012-04-251-23/+23
| | | | | | This renamed `git_khash_str` to `git_strmap`, `git_hash_oid` to `git_oidmap`, and deletes `git_hashtable` from the tree, plus adds unit tests for `git_strmap`.
* Convert hashtable usage over to khashRussell Belfer2012-04-251-60/+68
| | | | | | | | | | | | | | | This updates khash.h with some extra features (like error checking on allocations, ability to use wrapped malloc, foreach calls, etc), creates two high-level wrappers around khash: `git_khash_str` and `git_khash_oid` for string-to-void-ptr and oid-to-void-ptr tables, then converts all of the old usage of `git_hashtable` over to use these new hashtables. For `git_khash_str`, I've tried to create a set of macros that yield an API not too unlike the old `git_hashtable` API. Since the oid hashtable is only used in one file, I haven't bother to set up all those macros and just use the khash APIs directly for now.
* Clean up valgrind warningsCarlos Martín Nieto2012-04-041-1/+2
|
* Improve config handling for diff,submodules,attrsRussell Belfer2012-03-301-24/+15
| | | | | | | | 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-281-0/+384
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.