diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-05-08 01:47:33 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-05-09 11:58:19 -0700 |
commit | c4ce46fc7ac1b59372aa935e641ca15b12359f5b (patch) | |
tree | 000be1d69bef6c7129bdc97568d441e6b8e6615a /builtin/update-index.c | |
parent | 9cedd16c62e12521f35b44e10bba80bfe261e69c (diff) | |
download | git-c4ce46fc7ac1b59372aa935e641ca15b12359f5b.tar.gz git-c4ce46fc7ac1b59372aa935e641ca15b12359f5b.tar.xz |
index_fd(): turn write_object and format_check arguments into one flag
The "format_check" parameter tucked after the existing parameters is too
ugly an afterthought to live in any reasonable API.
Combine it with the other boolean parameter "write_object" into a single
"flags" parameter.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/update-index.c')
-rw-r--r-- | builtin/update-index.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/update-index.c b/builtin/update-index.c index d7850c630..f14bc9083 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -99,7 +99,8 @@ static int add_one_path(struct cache_entry *old, const char *path, int len, stru fill_stat_cache_info(ce, st); ce->ce_mode = ce_mode_from_stat(old, st->st_mode); - if (index_path(ce->sha1, path, st, !info_only)) + if (index_path(ce->sha1, path, st, + info_only ? 0 : HASH_WRITE_OBJECT)) return -1; option = allow_add ? ADD_CACHE_OK_TO_ADD : 0; option |= allow_replace ? ADD_CACHE_OK_TO_REPLACE : 0; |