index.h: Correct values for extended flags As libgit2 separates an index entry's 32-bit flag into two 16-bit values flags and flags_extended, the values of flags_extended need to be adjusted.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
diff --git a/include/git2/index.h b/include/git2/index.h
index 8a84f50..d69e58b 100644
--- a/include/git2/index.h
+++ b/include/git2/index.h
@@ -51,39 +51,29 @@ GIT_BEGIN_DECL
*
* In-memory only flags:
*/
-#define GIT_IDXENTRY_UPDATE (1 << 16)
-#define GIT_IDXENTRY_REMOVE (1 << 17)
-#define GIT_IDXENTRY_UPTODATE (1 << 18)
-#define GIT_IDXENTRY_ADDED (1 << 19)
+#define GIT_IDXENTRY_UPDATE (1 << 0)
+#define GIT_IDXENTRY_REMOVE (1 << 1)
+#define GIT_IDXENTRY_UPTODATE (1 << 2)
+#define GIT_IDXENTRY_ADDED (1 << 3)
-#define GIT_IDXENTRY_HASHED (1 << 20)
-#define GIT_IDXENTRY_UNHASHED (1 << 21)
-#define GIT_IDXENTRY_WT_REMOVE (1 << 22) /* remove in work directory */
-#define GIT_IDXENTRY_CONFLICTED (1 << 23)
+#define GIT_IDXENTRY_HASHED (1 << 4)
+#define GIT_IDXENTRY_UNHASHED (1 << 5)
+#define GIT_IDXENTRY_WT_REMOVE (1 << 6) /* remove in work directory */
+#define GIT_IDXENTRY_CONFLICTED (1 << 7)
-#define GIT_IDXENTRY_UNPACKED (1 << 24)
-#define GIT_IDXENTRY_NEW_SKIP_WORKTREE (1 << 25)
+#define GIT_IDXENTRY_UNPACKED (1 << 8)
+#define GIT_IDXENTRY_NEW_SKIP_WORKTREE (1 << 9)
/*
* Extended on-disk flags:
*/
-#define GIT_IDXENTRY_INTENT_TO_ADD (1 << 29)
-#define GIT_IDXENTRY_SKIP_WORKTREE (1 << 30)
+#define GIT_IDXENTRY_INTENT_TO_ADD (1 << 13)
+#define GIT_IDXENTRY_SKIP_WORKTREE (1 << 14)
/* GIT_IDXENTRY_EXTENDED2 is for future extension */
-#define GIT_IDXENTRY_EXTENDED2 (1 << 31)
+#define GIT_IDXENTRY_EXTENDED2 (1 << 15)
#define GIT_IDXENTRY_EXTENDED_FLAGS (GIT_IDXENTRY_INTENT_TO_ADD | GIT_IDXENTRY_SKIP_WORKTREE)
-/*
- * Safeguard to avoid saving wrong flags:
- * - GIT_IDXENTRY_EXTENDED2 won't get saved until its semantic is known
- * - Bits in 0x0000FFFF have been saved in flags already
- * - Bits in 0x003F0000 are currently in-memory flags
- */
-#if GIT_IDXENTRY_EXTENDED_FLAGS & 0x803FFFFF
-#error "GIT_IDXENTRY_EXTENDED_FLAGS out of range"
-#endif
-
/** Time used in a git index entry */
typedef struct {
git_time_t seconds;