diff options
author | Russell Belfer <rb@github.com> | 2012-08-10 06:43:25 +0400 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2012-08-24 22:00:27 +0400 |
commit | 5f4a61aea834fe25ce1596bc9c0e0b5e563aa98b (patch) | |
tree | da0237ee649e009b5f914dfdace54d26e819aaaf /src/submodule.h | |
parent | 0c8858de8c82bae3fd88513724689a07d231da7e (diff) |
Working implementation of git_submodule_status
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.
Diffstat (limited to 'src/submodule.h')
-rw-r--r-- | src/submodule.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/submodule.h b/src/submodule.h index 83bc7dfe9..c7a6aaf76 100644 --- a/src/submodule.h +++ b/src/submodule.h @@ -85,10 +85,18 @@ struct git_submodule { }; /* Additional flags on top of public GIT_SUBMODULE_STATUS values */ -#define GIT_SUBMODULE_STATUS__WD_SCANNED (1u << 15) -#define GIT_SUBMODULE_STATUS__HEAD_OID_VALID (1u << 16) -#define GIT_SUBMODULE_STATUS__INDEX_OID_VALID (1u << 17) -#define GIT_SUBMODULE_STATUS__WD_OID_VALID (1u << 18) -#define GIT_SUBMODULE_STATUS__INDEX_MULTIPLE_ENTRIES (1u << 19) +enum { + GIT_SUBMODULE_STATUS__WD_SCANNED = (1u << 20), + GIT_SUBMODULE_STATUS__HEAD_OID_VALID = (1u << 21), + GIT_SUBMODULE_STATUS__INDEX_OID_VALID = (1u << 22), + GIT_SUBMODULE_STATUS__WD_OID_VALID = (1u << 23), + GIT_SUBMODULE_STATUS__HEAD_NOT_SUBMODULE = (1u << 24), + GIT_SUBMODULE_STATUS__INDEX_NOT_SUBMODULE = (1u << 25), + GIT_SUBMODULE_STATUS__WD_NOT_SUBMODULE = (1u << 26), + GIT_SUBMODULE_STATUS__INDEX_MULTIPLE_ENTRIES = (1u << 27), +}; + +#define GIT_SUBMODULE_STATUS__CLEAR_INTERNAL(S) \ + ((S) & ~(0xFFFFFFFFu << 20)) #endif |