]> asedeno.scripts.mit.edu Git - git.git/blobdiff - wt-status.c
Improve use of lockfile API
[git.git] / wt-status.c
index 52ab41ceb6a5f839a3b0c9ffd69983ea5fdd60f7..c0c247243b562a7579ff780b80dffef4774b60a9 100644 (file)
@@ -8,6 +8,7 @@
 #include "revision.h"
 #include "diffcore.h"
 
+int wt_status_relative_paths = 1;
 int wt_status_use_color = 0;
 static char wt_status_colors[][COLOR_MAXLEN] = {
        "",         /* WT_STATUS_HEADER: normal */
@@ -121,6 +122,9 @@ static char *quote_path(const char *in, int len,
                }
        }
 
+       if (!out->len)
+               strbuf_addstr(out, "./");
+
        return out->buf;
 }
 
@@ -251,6 +255,7 @@ static void wt_status_print_updated(struct wt_status *s)
        rev.diffopt.format_callback_data = s;
        rev.diffopt.detect_rename = 1;
        rev.diffopt.rename_limit = 100;
+       rev.diffopt.break_opt = 0;
        wt_read_cache(s);
        run_diff_index(&rev, 1);
 }
@@ -376,6 +381,8 @@ void wt_status_print(struct wt_status *s)
        if (!s->commitable) {
                if (s->amend)
                        fprintf(s->fp, "# No changes\n");
+               else if (s->nowarn)
+                       ; /* nothing */
                else if (s->workdir_dirty)
                        printf("no changes added to commit (use \"git add\" and/or \"git commit -a\")\n");
                else if (s->workdir_untracked)
@@ -390,12 +397,17 @@ void wt_status_print(struct wt_status *s)
 int git_status_config(const char *k, const char *v)
 {
        if (!strcmp(k, "status.color") || !strcmp(k, "color.status")) {
-               wt_status_use_color = git_config_colorbool(k, v);
+               wt_status_use_color = git_config_colorbool(k, v, -1);
                return 0;
        }
        if (!prefixcmp(k, "status.color.") || !prefixcmp(k, "color.status.")) {
                int slot = parse_status_slot(k, 13);
                color_parse(v, k, wt_status_colors[slot]);
+               return 0;
+       }
+       if (!strcmp(k, "status.relativepaths")) {
+               wt_status_relative_paths = git_config_bool(k, v);
+               return 0;
        }
        return git_default_config(k, v);
 }