diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-02-06 01:26:13 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-02-06 01:26:13 +0300 |
commit | 1c418243a525328b7261ba2c1f2cd93fd52191a2 (patch) | |
tree | 89da5642eb0aa051a1508c5b3f0a7a3b6d42cf31 /read-cache.c | |
parent | f5dd919064c30fb8f22f022455eeaf975eff57c6 (diff) | |
parent | 9e5da3d055c558fc6492d3b996736ff7e8d115c3 (diff) |
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
Diffstat (limited to 'read-cache.c')
-rw-r--r-- | read-cache.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/read-cache.c b/read-cache.c index bfff271a3d..9783c493a3 100644 --- a/read-cache.c +++ b/read-cache.c @@ -703,10 +703,10 @@ int add_to_index(struct index_state *istate, const char *path, struct stat *st, 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); @@ -762,7 +762,7 @@ int add_to_index(struct index_state *istate, const char *path, struct stat *st, } } if (!intent_only) { - if (index_path(istate, &ce->oid, path, st, newflags)) { + if (index_path(istate, &ce->oid, path, st, hash_flags)) { discard_cache_entry(ce); return error(_("unable to index file '%s'"), path); } |