l10n: fr.po v2.11.0_rnd1
[gitweb.git] / wt-status.c
index 1a270571eebd7906f3cdb07cdc0c978f2b09cd57..a2e9d332d8332bb1dbeea26b683c5e3f032a822e 100644 (file)
@@ -368,11 +368,11 @@ static void wt_longstatus_print_change_data(struct wt_status *s,
                if (d->new_submodule_commits || d->dirty_submodule) {
                        strbuf_addstr(&extra, " (");
                        if (d->new_submodule_commits)
-                               strbuf_addf(&extra, _("new commits, "));
+                               strbuf_addstr(&extra, _("new commits, "));
                        if (d->dirty_submodule & DIRTY_SUBMODULE_MODIFIED)
-                               strbuf_addf(&extra, _("modified content, "));
+                               strbuf_addstr(&extra, _("modified content, "));
                        if (d->dirty_submodule & DIRTY_SUBMODULE_UNTRACKED)
-                               strbuf_addf(&extra, _("untracked content, "));
+                               strbuf_addstr(&extra, _("untracked content, "));
                        strbuf_setlen(&extra, extra.len - 2);
                        strbuf_addch(&extra, ')');
                }
@@ -438,7 +438,7 @@ static void wt_status_collect_changed_cb(struct diff_queue_struct *q,
 
                switch (p->status) {
                case DIFF_STATUS_ADDED:
-                       die("BUG: worktree status add???");
+                       d->mode_worktree = p->two->mode;
                        break;
 
                case DIFF_STATUS_DELETED:
@@ -548,6 +548,7 @@ static void wt_status_collect_changes_worktree(struct wt_status *s)
        setup_revisions(0, NULL, &rev, NULL);
        rev.diffopt.output_format |= DIFF_FORMAT_CALLBACK;
        DIFF_OPT_SET(&rev.diffopt, DIRTY_SUBMODULES);
+       rev.diffopt.ita_invisible_in_index = 1;
        if (!s->show_untracked_files)
                DIFF_OPT_SET(&rev.diffopt, IGNORE_UNTRACKED_IN_SUBMODULES);
        if (s->ignore_submodule_arg) {
@@ -571,6 +572,7 @@ static void wt_status_collect_changes_index(struct wt_status *s)
        setup_revisions(0, NULL, &rev, &opt);
 
        DIFF_OPT_SET(&rev.diffopt, OVERRIDE_SUBMODULE_CONFIG);
+       rev.diffopt.ita_invisible_in_index = 1;
        if (s->ignore_submodule_arg) {
                handle_ignore_submodules_arg(&rev.diffopt, s->ignore_submodule_arg);
        } else {
@@ -606,6 +608,8 @@ static void wt_status_collect_changes_initial(struct wt_status *s)
 
                if (!ce_path_match(ce, &s->pathspec, NULL))
                        continue;
+               if (ce_intent_to_add(ce))
+                       continue;
                it = string_list_insert(&s->change, ce->name);
                d = it->util;
                if (!d) {
@@ -624,7 +628,7 @@ static void wt_status_collect_changes_initial(struct wt_status *s)
                        d->index_status = DIFF_STATUS_ADDED;
                        /* Leave {mode,oid}_head zero for adds. */
                        d->mode_index = ce->ce_mode;
-                       hashcpy(d->oid_index.hash, ce->sha1);
+                       hashcpy(d->oid_index.hash, ce->oid.hash);
                }
        }
 }
@@ -912,6 +916,7 @@ static void wt_longstatus_print_verbose(struct wt_status *s)
 
        init_revisions(&rev, NULL);
        DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV);
+       rev.diffopt.ita_invisible_in_index = 1;
 
        memset(&opt, 0, sizeof(opt));
        opt.def = s->is_initial ? EMPTY_TREE_SHA1_HEX : s->reference;
@@ -1111,7 +1116,6 @@ static void abbrev_sha1_in_line(struct strbuf *line)
        split = strbuf_split_max(line, ' ', 3);
        if (split[0] && split[1]) {
                unsigned char sha1[20];
-               const char *abbrev;
 
                /*
                 * strbuf_split_max left a space. Trim it and re-add
@@ -1119,9 +1123,10 @@ static void abbrev_sha1_in_line(struct strbuf *line)
                 */
                strbuf_trim(split[1]);
                if (!get_sha1(split[1]->buf, sha1)) {
-                       abbrev = find_unique_abbrev(sha1, DEFAULT_ABBREV);
                        strbuf_reset(split[1]);
-                       strbuf_addf(split[1], "%s ", abbrev);
+                       strbuf_add_unique_abbrev(split[1], sha1,
+                                                DEFAULT_ABBREV);
+                       strbuf_addch(split[1], ' ');
                        strbuf_reset(line);
                        for (i = 0; split[i]; i++)
                                strbuf_addbuf(line, split[i]);
@@ -1344,10 +1349,8 @@ static char *get_branch(const struct worktree *wt, const char *path)
        else if (starts_with(sb.buf, "refs/"))
                ;
        else if (!get_sha1_hex(sb.buf, sha1)) {
-               const char *abbrev;
-               abbrev = find_unique_abbrev(sha1, DEFAULT_ABBREV);
                strbuf_reset(&sb);
-               strbuf_addstr(&sb, abbrev);
+               strbuf_add_unique_abbrev(&sb, sha1, DEFAULT_ABBREV);
        } else if (!strcmp(sb.buf, "detached HEAD")) /* rebase */
                goto got_nothing;
        else                    /* bisect */
@@ -1384,8 +1387,7 @@ static int grab_1st_switch(unsigned char *osha1, unsigned char *nsha1,
        if (!strcmp(cb->buf.buf, "HEAD")) {
                /* HEAD is relative. Resolve it to the right reflog entry. */
                strbuf_reset(&cb->buf);
-               strbuf_addstr(&cb->buf,
-                             find_unique_abbrev(nsha1, DEFAULT_ABBREV));
+               strbuf_add_unique_abbrev(&cb->buf, nsha1, DEFAULT_ABBREV);
        }
        return 1;
 }
@@ -2094,7 +2096,7 @@ static void wt_porcelain_v2_print_unmerged_entry(
                if (strcmp(ce->name, it->string) || !stage)
                        break;
                stages[stage - 1].mode = ce->ce_mode;
-               hashcpy(stages[stage - 1].oid.hash, ce->sha1);
+               hashcpy(stages[stage - 1].oid.hash, ce->oid.hash);
                sum |= (1 << (stage - 1));
        }
        if (sum != d->stagemask)
@@ -2265,15 +2267,15 @@ int require_clean_work_tree(const char *action, const char *hint, int ignore_sub
 
        if (has_unstaged_changes(ignore_submodules)) {
                /* TRANSLATORS: the action is e.g. "pull with rebase" */
-               error(_("Cannot %s: You have unstaged changes."), _(action));
+               error(_("cannot %s: You have unstaged changes."), _(action));
                err = 1;
        }
 
        if (has_uncommitted_changes(ignore_submodules)) {
                if (err)
-                       error(_("Additionally, your index contains uncommitted changes."));
+                       error(_("additionally, your index contains uncommitted changes."));
                else
-                       error(_("Cannot %s: Your index contains uncommitted changes."),
+                       error(_("cannot %s: Your index contains uncommitted changes."),
                              _(action));
                err = 1;
        }