"use \"git add/rm <file>...\" to update what will be committed";
static const char use_add_to_include_msg[] =
"use \"git add <file>...\" to include in what will be committed";
+static const char *excludes_file;
static int parse_status_slot(const char *var, int offset)
{
wt_status_print_trailer();
}
-void wt_status_print_initial(struct wt_status *s)
+static void wt_read_cache(struct wt_status *s)
+{
+ discard_cache();
+ read_cache();
+}
+
+static void wt_status_print_initial(struct wt_status *s)
{
int i;
char buf[PATH_MAX];
- read_cache();
+ wt_read_cache(s);
if (active_nr) {
s->commitable = 1;
wt_status_print_cached_header(NULL);
rev.diffopt.format_callback = wt_status_print_updated_cb;
rev.diffopt.format_callback_data = s;
rev.diffopt.detect_rename = 1;
+ rev.diffopt.rename_limit = 100;
+ wt_read_cache(s);
run_diff_index(&rev, 1);
}
rev.diffopt.output_format |= DIFF_FORMAT_CALLBACK;
rev.diffopt.format_callback = wt_status_print_changed_cb;
rev.diffopt.format_callback_data = s;
+ wt_read_cache(s);
run_diff_files(&rev, 0);
}
x = git_path("info/exclude");
if (file_exists(x))
add_excludes_from_file(&dir, x);
+ if (excludes_file && file_exists(excludes_file))
+ add_excludes_from_file(&dir, excludes_file);
- read_directory(&dir, ".", "", 0);
+ read_directory(&dir, ".", "", 0, NULL);
for(i = 0; i < dir.nr; i++) {
/* check for matching entry, which is unmerged; lifted from
* builtin-ls-files:show_other_files */
setup_revisions(0, NULL, &rev, s->reference);
rev.diffopt.output_format |= DIFF_FORMAT_PATCH;
rev.diffopt.detect_rename = 1;
+ wt_read_cache(s);
run_diff_index(&rev, 1);
}
}
else {
wt_status_print_updated(s);
- discard_cache();
}
wt_status_print_changed(s);
int slot = parse_status_slot(k, 13);
color_parse(v, k, wt_status_colors[slot]);
}
+ if (!strcmp(k, "core.excludesfile")) {
+ if (!v)
+ die("core.excludesfile without value");
+ excludes_file = xstrdup(v);
+ return 0;
+ }
return git_default_config(k, v);
}