From: Junio C Hamano Date: Tue, 5 Feb 2019 22:26:13 +0000 (-0800) Subject: Merge branch 'jk/add-ignore-errors-bit-assignment-fix' X-Git-Tag: v2.21.0-rc0~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1c418243a525328b7261ba2c1f2cd93fd52191a2;p=git Merge branch 'jk/add-ignore-errors-bit-assignment-fix' "git add --ignore-errors" did not work as advertised and instead worked as an unintended synonym for "git add --renormalize", which has been fixed. * jk/add-ignore-errors-bit-assignment-fix: add: use separate ADD_CACHE_RENORMALIZE flag --- 1c418243a525328b7261ba2c1f2cd93fd52191a2 diff --cc read-cache.c index bfff271a3d,ce679c1799..9783c493a3 --- a/read-cache.c +++ b/read-cache.c @@@ -703,13 -694,13 +703,13 @@@ int add_to_index(struct index_state *is int intent_only = flags & ADD_CACHE_INTENT; int add_option = (ADD_CACHE_OK_TO_ADD|ADD_CACHE_OK_TO_REPLACE| (intent_only ? ADD_CACHE_NEW_ONLY : 0)); - int newflags = HASH_WRITE_OBJECT; + int hash_flags = HASH_WRITE_OBJECT; - if (flags & HASH_RENORMALIZE) - newflags |= HASH_RENORMALIZE; + if (flags & ADD_CACHE_RENORMALIZE) + hash_flags |= HASH_RENORMALIZE; if (!S_ISREG(st_mode) && !S_ISLNK(st_mode) && !S_ISDIR(st_mode)) - return error("%s: can only add regular files, symbolic links or git-directories", path); + return error(_("%s: can only add regular files, symbolic links or git-directories"), path); namelen = strlen(path); if (S_ISDIR(st_mode)) { @@@ -762,9 -753,9 +762,9 @@@ } } if (!intent_only) { - if (index_path(istate, &ce->oid, path, st, newflags)) { - if (index_path(&ce->oid, path, st, hash_flags)) { ++ if (index_path(istate, &ce->oid, path, st, hash_flags)) { discard_cache_entry(ce); - return error("unable to index file %s", path); + return error(_("unable to index file '%s'"), path); } } else set_object_name_for_intent_to_add_entry(ce);