summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2016-06-06 18:16:40 +0700
committerJunio C Hamano <gitster@pobox.com>2016-06-06 15:25:38 -0700
commit80bd6efc1a3f1f482f1d2212996a0d85fccfd7b3 (patch)
tree55418b17d2444a1ecb77169858bd1b5451fb7cca
parent49fa3dc76179e04b0833542fa52d0f287a4955ac (diff)
downloadgit-80bd6efc1a3f1f482f1d2212996a0d85fccfd7b3.tar.gz
diff.h: extend "flags" field to 64 bits because we're out of bits
Current flags field is 32-bits, all used except one bit and we need one more bit is needed for to toggle i-t-a behavior. The 9th bit could be reused for this, but we could just extend it to 64 bits now to give room for more future flags. gcc -Wconversion is used to catch assignments that truncate bits. No new warning was introduced (in fact one in index_differs_from() was eliminated), Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/commit.c2
-rw-r--r--diff-lib.c4
-rw-r--r--diff.c2
-rw-r--r--diff.h6
4 files changed, 7 insertions, 7 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 443ff9196d..fcfaa2b3a0 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -906,7 +906,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
* submodules which were manually staged, which would
* be really confusing.
*/
- int diff_flags = DIFF_OPT_OVERRIDE_SUBMODULE_CONFIG;
+ uint64_t diff_flags = DIFF_OPT_OVERRIDE_SUBMODULE_CONFIG;
if (ignore_submodule_arg &&
!strcmp(ignore_submodule_arg, "all"))
diff_flags |= DIFF_OPT_IGNORE_SUBMODULES;
diff --git a/diff-lib.c b/diff-lib.c
index bc49c708c1..27887d08d0 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -71,7 +71,7 @@ static int match_stat_with_submodule(struct diff_options *diffopt,
{
int changed = ce_match_stat(ce, st, ce_option);
if (S_ISGITLINK(ce->ce_mode)) {
- unsigned orig_flags = diffopt->flags;
+ uint64_t orig_flags = diffopt->flags;
if (!DIFF_OPT_TST(diffopt, OVERRIDE_SUBMODULE_CONFIG))
set_diffopt_flags_from_submodule_config(diffopt, ce->name);
if (DIFF_OPT_TST(diffopt, IGNORE_SUBMODULES))
@@ -516,7 +516,7 @@ int do_diff_cache(const unsigned char *tree_sha1, struct diff_options *opt)
return 0;
}
-int index_differs_from(const char *def, int diff_flags)
+int index_differs_from(const char *def, uint64_t diff_flags)
{
struct rev_info rev;
struct setup_revision_opt opt;
diff --git a/diff.c b/diff.c
index d3734d3181..f70425f6b3 100644
--- a/diff.c
+++ b/diff.c
@@ -4936,7 +4936,7 @@ int diff_can_quit_early(struct diff_options *opt)
static int is_submodule_ignored(const char *path, struct diff_options *options)
{
int ignored = 0;
- unsigned orig_flags = options->flags;
+ uint64_t orig_flags = options->flags;
if (!DIFF_OPT_TST(options, OVERRIDE_SUBMODULE_CONFIG))
set_diffopt_flags_from_submodule_config(options, path);
if (DIFF_OPT_TST(options, IGNORE_SUBMODULES))
diff --git a/diff.h b/diff.h
index 125447be09..b497078c2f 100644
--- a/diff.h
+++ b/diff.h
@@ -115,8 +115,8 @@ struct diff_options {
const char *pickaxe;
const char *single_follow;
const char *a_prefix, *b_prefix;
- unsigned flags;
- unsigned touched_flags;
+ uint64_t flags;
+ uint64_t touched_flags;
/* diff-filter bits */
unsigned int filter;
@@ -348,7 +348,7 @@ extern int diff_result_code(struct diff_options *, int);
extern void diff_no_index(struct rev_info *, int, const char **);
-extern int index_differs_from(const char *def, int diff_flags);
+extern int index_differs_from(const char *def, uint64_t diff_flags);
/*
* Fill the contents of the filespec "df", respecting any textconv defined by