From: Junio C Hamano Date: Fri, 13 May 2011 18:01:15 +0000 (-0700) Subject: Merge branch 'jc/fix-add-u-unmerged' X-Git-Tag: v1.7.6-rc0~78 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f7d59e256884f63adeed9a1f3376a386a28681ff;p=git.git Merge branch 'jc/fix-add-u-unmerged' * jc/fix-add-u-unmerged: Fix "add -u" that sometimes fails to resolve unmerged paths --- f7d59e256884f63adeed9a1f3376a386a28681ff diff --cc builtin/add.c index d39a6ab93,027ca3b6d..704141fdd --- a/builtin/add.c +++ b/builtin/add.c @@@ -35,30 -57,9 +56,9 @@@ static void update_callback(struct diff for (i = 0; i < q->nr; i++) { struct diff_filepair *p = q->queue[i]; const char *path = p->one->path; - switch (p->status) { + switch (fix_unmerged_status(p, data)) { default: - die("unexpected diff status %c", p->status); + die(_("unexpected diff status %c"), p->status); - case DIFF_STATUS_UNMERGED: - /* - * ADD_CACHE_IGNORE_REMOVAL is unset if "git - * add -u" is calling us, In such a case, a - * missing work tree file needs to be removed - * if there is an unmerged entry at stage #2, - * but such a diff record is followed by - * another with DIFF_STATUS_DELETED (and if - * there is no stage #2, we won't see DELETED - * nor MODIFIED). We can simply continue - * either way. - */ - if (!(data->flags & ADD_CACHE_IGNORE_REMOVAL)) - continue; - /* - * Otherwise, it is "git add path" is asking - * to explicitly add it; we fall through. A - * missing work tree file is an error and is - * caught by add_file_to_index() in such a - * case. - */ case DIFF_STATUS_MODIFIED: case DIFF_STATUS_TYPE_CHANGED: if (add_file_to_index(&the_index, path, data->flags)) {