summaryrefslogtreecommitdiff
path: root/include/git2/types.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-06-29 23:22:31 -0700
committerRussell Belfer <rb@github.com>2013-07-10 12:15:03 -0700
commitf9775a37aa4ed042839a6b2f9d8e0dfbd73a2f09 (patch)
treed4e0fde8c090bf7d301dfa673538dd17d9a77f96 /include/git2/types.h
parent2e3e273e33894bc1089cfc09d89bd2cb144b108d (diff)
downloadlibgit2-f9775a37aa4ed042839a6b2f9d8e0dfbd73a2f09.tar.gz
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.
Diffstat (limited to 'include/git2/types.h')
-rw-r--r--include/git2/types.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/git2/types.h b/include/git2/types.h
index dc344075c..1da0d3ed2 100644
--- a/include/git2/types.h
+++ b/include/git2/types.h
@@ -229,6 +229,40 @@ typedef struct git_transfer_progress {
*/
typedef int (*git_transfer_progress_callback)(const git_transfer_progress *stats, void *payload);
+/**
+ * Opaque structure representing a submodule.
+ */
+typedef struct git_submodule git_submodule;
+
+/**
+ * Values that could be specified for the update rule of a submodule.
+ *
+ * Use the RESET value if you have altered the in-memory update value via
+ * `git_submodule_set_update()` and wish to reset to the original default.
+ */
+typedef enum {
+ GIT_SUBMODULE_UPDATE_RESET = -1,
+ GIT_SUBMODULE_UPDATE_CHECKOUT = 1,
+ GIT_SUBMODULE_UPDATE_REBASE = 2,
+ GIT_SUBMODULE_UPDATE_MERGE = 3,
+ GIT_SUBMODULE_UPDATE_NONE = 4
+} git_submodule_update_t;
+
+/**
+ * Values that could be specified for how closely to examine the
+ * working directory when getting submodule status.
+ *
+ * Use the RESET value if you have altered the in-memory ignore value via
+ * `git_submodule_set_ignore()` and wish to reset to the original value.
+ */
+typedef enum {
+ GIT_SUBMODULE_IGNORE_RESET = -1, /* reset to on-disk value */
+ GIT_SUBMODULE_IGNORE_NONE = 1, /* any change or untracked == dirty */
+ GIT_SUBMODULE_IGNORE_UNTRACKED = 2, /* dirty if tracked files change */
+ GIT_SUBMODULE_IGNORE_DIRTY = 3, /* only dirty if HEAD moved */
+ GIT_SUBMODULE_IGNORE_ALL = 4 /* never dirty */
+} git_submodule_ignore_t;
+
/** @} */
GIT_END_DECL