]> git.ipfire.org Git - thirdparty/git.git/blobdiff - wt-status.c
Merge git://git.bogomips.org/git-svn
[thirdparty/git.git] / wt-status.c
index 055022241fc1e40eb38b8f304983e57d638301db..9f4e0ba9c17120ca2903b30b95b6d8fbcc62cd9c 100644 (file)
@@ -134,7 +134,7 @@ static void wt_status_print_unmerged_header(struct wt_status *s)
        status_printf_ln(s, c, _("Unmerged paths:"));
        if (!advice_status_hints)
                return;
-       if (s->in_merge)
+       if (s->whence != FROM_COMMIT)
                ;
        else if (!s->is_initial)
                status_printf_ln(s, c, _("  (use \"git reset %s <file>...\" to unstage)"), s->reference);
@@ -148,10 +148,10 @@ static void wt_status_print_cached_header(struct wt_status *s)
 {
        const char *c = color(WT_STATUS_HEADER, s);
 
-       status_printf_ln(s, c, "Changes to be committed:");
+       status_printf_ln(s, c, _("Changes to be committed:"));
        if (!advice_status_hints)
                return;
-       if (s->in_merge)
+       if (s->whence != FROM_COMMIT)
                ; /* NEEDSWORK: use "git reset --unresolve"??? */
        else if (!s->is_initial)
                status_printf_ln(s, c, _("  (use \"git reset %s <file>...\" to unstage)"), s->reference);
@@ -275,7 +275,7 @@ static void wt_status_print_change_data(struct wt_status *s,
                status_printf_more(s, c, _("modified:   %s"), one);
                break;
        case DIFF_STATUS_RENAMED:
-               status_printf_more(s, c, "renamed:    %s -> %s", one, two);
+               status_printf_more(s, c, _("renamed:    %s -> %s"), one, two);
                break;
        case DIFF_STATUS_TYPE_CHANGED:
                status_printf_more(s, c, _("typechange: %s"), one);
@@ -397,7 +397,7 @@ static void wt_status_collect_changes_worktree(struct wt_status *s)
     }
        rev.diffopt.format_callback = wt_status_collect_changed_cb;
        rev.diffopt.format_callback_data = s;
-       rev.prune_data = s->pathspec;
+       init_pathspec(&rev.prune_data, s->pathspec);
        run_diff_files(&rev, 0);
 }
 
@@ -422,20 +422,22 @@ static void wt_status_collect_changes_index(struct wt_status *s)
        rev.diffopt.detect_rename = 1;
        rev.diffopt.rename_limit = 200;
        rev.diffopt.break_opt = 0;
-       rev.prune_data = s->pathspec;
+       init_pathspec(&rev.prune_data, s->pathspec);
        run_diff_index(&rev, 1);
 }
 
 static void wt_status_collect_changes_initial(struct wt_status *s)
 {
+       struct pathspec pathspec;
        int i;
 
+       init_pathspec(&pathspec, s->pathspec);
        for (i = 0; i < active_nr; i++) {
                struct string_list_item *it;
                struct wt_status_change_data *d;
                struct cache_entry *ce = active_cache[i];
 
-               if (!ce_path_match(ce, s->pathspec))
+               if (!ce_path_match(ce, &pathspec))
                        continue;
                it = string_list_insert(&s->change, ce->name);
                d = it->util;
@@ -450,6 +452,7 @@ static void wt_status_collect_changes_initial(struct wt_status *s)
                else
                        d->index_status = DIFF_STATUS_ADDED;
        }
+       free_pathspec(&pathspec);
 }
 
 static void wt_status_collect_untracked(struct wt_status *s)
@@ -725,7 +728,7 @@ void wt_status_print(struct wt_status *s)
 
        if (s->is_initial) {
                status_printf_ln(s, color(WT_STATUS_HEADER, s), "");
-               status_printf_ln(s, color(WT_STATUS_HEADER, s), "Initial commit");
+               status_printf_ln(s, color(WT_STATUS_HEADER, s), _("Initial commit"));
                status_printf_ln(s, color(WT_STATUS_HEADER, s), "");
        }
 
@@ -763,14 +766,14 @@ void wt_status_print(struct wt_status *s)
                                advice_status_hints
                                ? _(" (use \"git add\" to track)") : "");
                else if (s->is_initial)
-                       printf("nothing to commit%s\n", advice_status_hints
-                               ? " (create/copy files and use \"git add\" to track)" : "");
+                       printf(_("nothing to commit%s\n"), advice_status_hints
+                               ? _(" (create/copy files and use \"git add\" to track)") : "");
                else if (!s->show_untracked_files)
-                       printf("nothing to commit%s\n", advice_status_hints
-                               ? " (use -u to show untracked files)" : "");
+                       printf(_("nothing to commit%s\n"), advice_status_hints
+                               ? _(" (use -u to show untracked files)") : "");
                else
-                       printf("nothing to commit%s\n", advice_status_hints
-                               ? " (working directory clean)" : "");
+                       printf(_("nothing to commit%s\n"), advice_status_hints
+                               ? _(" (working directory clean)") : "");
        }
 }
 
@@ -878,13 +881,13 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
        if (!prefixcmp(branch_name, "refs/heads/"))
                branch_name += 11;
        else if (!strcmp(branch_name, "HEAD")) {
-               branch_name = "HEAD (no branch)";
+               branch_name = _("HEAD (no branch)");
                branch_color_local = color(WT_STATUS_NOBRANCH, s);
        }
 
        branch = branch_get(s->branch + 11);
        if (s->is_initial)
-               color_fprintf(s->fp, header_color, "Initial commit on ");
+               color_fprintf(s->fp, header_color, _("Initial commit on "));
        if (!stat_tracking_info(branch, &num_ours, &num_theirs)) {
                color_fprintf_ln(s->fp, branch_color_local,
                        "%s", branch_name);
@@ -899,15 +902,15 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
 
        color_fprintf(s->fp, header_color, " [");
        if (!num_ours) {
-               color_fprintf(s->fp, header_color, "behind ");
+               color_fprintf(s->fp, header_color, _("behind "));
                color_fprintf(s->fp, branch_color_remote, "%d", num_theirs);
        } else if (!num_theirs) {
-               color_fprintf(s->fp, header_color, "ahead ");
+               color_fprintf(s->fp, header_color, _("ahead "));
                color_fprintf(s->fp, branch_color_local, "%d", num_ours);
        } else {
-               color_fprintf(s->fp, header_color, "ahead ");
+               color_fprintf(s->fp, header_color, _("ahead "));
                color_fprintf(s->fp, branch_color_local, "%d", num_ours);
-               color_fprintf(s->fp, header_color, ", behind ");
+               color_fprintf(s->fp, header_color, _(", behind "));
                color_fprintf(s->fp, branch_color_remote, "%d", num_theirs);
        }