diff options
author | Russell Belfer <rb@github.com> | 2013-06-29 13:16:33 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-07-10 12:14:13 -0700 |
commit | 1aad6137d218830bc280c4327595182019164515 (patch) | |
tree | 145febdd56cc283d8c9024b08db94764c0ea0727 /include/git2/submodule.h | |
parent | 3fe046cfdba414f69b09e76da2a550be96eeab7e (diff) | |
download | libgit2-1aad6137d218830bc280c4327595182019164515.tar.gz |
Submodule status improvements
This fixes the way that submodule status is checked to bypass just
about all of the caching in the submodule object. Based on the
ignore value, it will try to do the minimum work necessary to find
the current status of the submodule - but it will actually go to
disk to get all of the current values.
This also removes the custom refcounting stuff in favor of the
common git_refcount style. Right now, it is still for internal
purposes only, but it should make it easier to add true submodule
refcounting in the future with a public git_submodule_free call
that will allow bindings not to worry about the submodule object
getting freed from underneath them.
Diffstat (limited to 'include/git2/submodule.h')
-rw-r--r-- | include/git2/submodule.h | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/include/git2/submodule.h b/include/git2/submodule.h index 91b5300ae..3267bcd0f 100644 --- a/include/git2/submodule.h +++ b/include/git2/submodule.h @@ -119,19 +119,9 @@ typedef enum { GIT_SUBMODULE_STATUS_WD_UNTRACKED = (1u << 13), } git_submodule_status_t; -#define GIT_SUBMODULE_STATUS__IN_FLAGS \ - (GIT_SUBMODULE_STATUS_IN_HEAD | \ - GIT_SUBMODULE_STATUS_IN_INDEX | \ - GIT_SUBMODULE_STATUS_IN_CONFIG | \ - GIT_SUBMODULE_STATUS_IN_WD) - -#define GIT_SUBMODULE_STATUS__INDEX_FLAGS \ - (GIT_SUBMODULE_STATUS_INDEX_ADDED | \ - GIT_SUBMODULE_STATUS_INDEX_DELETED | \ - GIT_SUBMODULE_STATUS_INDEX_MODIFIED) - -#define GIT_SUBMODULE_STATUS__WD_FLAGS \ - ~(GIT_SUBMODULE_STATUS__IN_FLAGS | GIT_SUBMODULE_STATUS__INDEX_FLAGS) +#define GIT_SUBMODULE_STATUS__IN_FLAGS 0x000Fu +#define GIT_SUBMODULE_STATUS__INDEX_FLAGS 0x0070u +#define GIT_SUBMODULE_STATUS__WD_FLAGS 0x3F80u #define GIT_SUBMODULE_STATUS_IS_UNMODIFIED(S) \ (((S) & ~GIT_SUBMODULE_STATUS__IN_FLAGS) == 0) |