Commit Graph

7 Commits

Author SHA1 Message Date
Russell Belfer
f9775a37aa Add ignore_submodules to diff options
This adds correct support for an equivalent to --ignore-submodules
in diff, where an actual ignore value can be passed to diff to
override the per submodule settings in the configuration.

This required tweaking the constants for ignore values so that
zero would not be used and could represent an unset option to the
diff.  This was an opportunity to move the submodule values into
include/git2/types.h and to rename the poorly named DEFAULT values
for ignore and update constants to RESET instead.

Now the GIT_DIFF_IGNORE_SUBMODULES flag is exactly the same as
setting the ignore_submodules option to GIT_SUBMODULE_IGNORE_ALL
(which is actually a minor change from the old behavior in that
submodules will now be treated as UNMODIFIED deltas instead of
being left out totally - if you set GIT_DIFF_INCLUDE_UNMODIFIED).

This includes tests for the various new settings.
2013-07-10 12:15:03 -07:00
Russell Belfer
65025cb893 Three submodule status bug fixes
1. Fix sort order problem with submodules where "mod" was sorting
   after "mod-plus" because they were being sorted as "mod/" and
   "mod-plus/".  This involved pushing the "contains a .git entry"
   test significantly lower in the stack.
2. Reinstate behavior that a directory which contains a .git entry
   will be treated as a submodule during iteration even if it is
   not yet added to the .gitmodules.
3. Now that any directory containing .git is reported as submodule,
   we have to be more careful checking for GIT_EEXISTS when we
   do a submodule lookup, because that is the error code that is
   returned by git_submodule_lookup when you try to look up a
   directory containing .git that has no record in gitmodules or
   the index.
2013-03-18 17:24:13 -07:00
Ben Straub
54b2a37ac7 Clean up config.h 2012-11-27 13:18:28 -08:00
yorah
a1abe66aca Add config level support in the config API
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
2012-10-23 12:48:38 +02:00
Russell Belfer
17b06f4d47 Add missing accessor for fetchRecurseSubmodules
When `git_submodule` became an opaque structure, I forgot to add
accessor functions for the fetchRecurseSubmodules config setting.
This fixes that.
2012-09-07 15:49:08 -07:00
Russell Belfer
0c8858de8c Fix valgrind issues and leaks
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.
2012-08-24 11:00:27 -07:00
Russell Belfer
aa13bf05c8 Major submodule rewrite
This replaces the old submodule API with a new extended API that
supports most of the things that can be done with `git submodule`.
2012-08-24 11:00:26 -07:00