Code

Bash completion support for aliases
[git.git] / wt-status.c
index ec2c7286b1fdbddda8e305a32549ca1362e36b64..3952809c2a2d5526e5b97ad57a53b601906e01a2 100644 (file)
@@ -50,6 +50,7 @@ void wt_status_prepare(struct wt_status *s)
        s->amend = 0;
        s->verbose = 0;
        s->commitable = 0;
+       s->untracked = 0;
 }
 
 static void wt_status_print_header(const char *main, const char *sub)
@@ -71,25 +72,25 @@ static void wt_status_print_filepair(int t, struct diff_filepair *p)
        color_printf(color(WT_STATUS_HEADER), "#\t");
        switch (p->status) {
        case DIFF_STATUS_ADDED:
-               color_printf(c, "new file: %s", p->one->path); break;
+               color_printf(c, "new file:   %s", p->one->path); break;
        case DIFF_STATUS_COPIED:
-               color_printf(c, "copied: %s -> %s",
+               color_printf(c, "copied:     %s -> %s",
                                p->one->path, p->two->path);
                break;
        case DIFF_STATUS_DELETED:
-               color_printf_ln(c, "deleted: %s", p->one->path); break;
+               color_printf(c, "deleted:    %s", p->one->path); break;
        case DIFF_STATUS_MODIFIED:
-               color_printf(c, "modified: %s", p->one->path); break;
+               color_printf(c, "modified:   %s", p->one->path); break;
        case DIFF_STATUS_RENAMED:
-               color_printf(c, "renamed: %s -> %s",
+               color_printf(c, "renamed:    %s -> %s",
                                p->one->path, p->two->path);
                break;
        case DIFF_STATUS_TYPE_CHANGED:
                color_printf(c, "typechange: %s", p->one->path); break;
        case DIFF_STATUS_UNKNOWN:
-               color_printf(c, "unknown: %s", p->one->path); break;
+               color_printf(c, "unknown:    %s", p->one->path); break;
        case DIFF_STATUS_UNMERGED:
-               color_printf(c, "unmerged: %s", p->one->path); break;
+               color_printf(c, "unmerged:   %s", p->one->path); break;
        default:
                die("bug: unhandled diff status %c", p->status);
        }
@@ -188,6 +189,10 @@ static void wt_status_print_untracked(const struct wt_status *s)
        memset(&dir, 0, sizeof(dir));
 
        dir.exclude_per_dir = ".gitignore";
+       if (!s->untracked) {
+               dir.show_other_directories = 1;
+               dir.hide_empty_directories = 1;
+       }
        x = git_path("info/exclude");
        if (file_exists(x))
                add_excludes_from_file(&dir, x);