Skip to content

Commit b837f5d

Browse files
peffgitster
authored andcommitted
diff_filespec: reorder dirty_submodule macro definitions
diff_filespec has a 2-bit "dirty_submodule" field and defines two flags as macros. Originally these were right next to each other, but a new field was accidentally added in between in commit 4682d85. This patch puts the field and its flags back together. Using an enum like: enum { DIRTY_SUBMODULE_UNTRACKED = 1, DIRTY_SUBMODULE_MODIFIED = 2 } dirty_submodule; would be more obvious, but it bloats the structure. Limiting the enum size like: } dirty_submodule : 2; might work, but it is not portable. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4224916 commit b837f5d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

diffcore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ struct diff_filespec {
4343
unsigned should_free : 1; /* data should be free()'ed */
4444
unsigned should_munmap : 1; /* data should be munmap()'ed */
4545
unsigned dirty_submodule : 2; /* For submodules: its work tree is dirty */
46-
unsigned is_stdin : 1;
4746
#define DIRTY_SUBMODULE_UNTRACKED 1
4847
#define DIRTY_SUBMODULE_MODIFIED 2
48+
unsigned is_stdin : 1;
4949
unsigned has_more_entries : 1; /* only appear in combined diff */
5050
struct userdiff_driver *driver;
5151
/* data should be considered "binary"; -1 means "don't know yet" */

0 commit comments

Comments
 (0)