Code

modify/delete conflict resolution overwrites untracked file
[git.git] / wt-status.c
index eeb106e13e88c3ee2f61df41017e47b221f10ae3..64cedfcbe14ab0448ab6225b50244a45492a546a 100644 (file)
@@ -275,20 +275,9 @@ static void wt_status_print_untracked(struct wt_status *s)
 
        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 */
                struct dir_entry *ent = dir.entries[i];
-               int pos = cache_name_pos(ent->name, ent->len);
-               struct cache_entry *ce;
-               if (0 <= pos)
-                       die("bug in wt_status_print_untracked");
-               pos = -pos - 1;
-               if (pos < active_nr) {
-                       ce = active_cache[pos];
-                       if (ce_namelen(ce) == ent->len &&
-                           !memcmp(ce->name, ent->name, ent->len))
-                               continue;
-               }
+               if (!cache_name_is_other(ent->name, ent->len))
+                       continue;
                if (!shown_header) {
                        s->workdir_untracked = 1;
                        wt_status_print_header(s, "Untracked files",
@@ -421,7 +410,7 @@ int git_status_config(const char *k, const char *v, void *cb)
        }
        if (!strcmp(k, "status.showuntrackedfiles")) {
                if (!v)
-                       return config_error_nonbool(v);
+                       return config_error_nonbool(k);
                else if (!strcmp(v, "no"))
                        show_untracked_files = SHOW_NO_UNTRACKED_FILES;
                else if (!strcmp(v, "normal"))