convert run_add_interactive to use struct pathspec
[gitweb.git] / builtin / commit.c
index 530f0eddc2e41a67992bf73dc81b7502e96181e5..0344ec72afd171c6c55386eb70432745dbc01248 100644 (file)
@@ -294,7 +294,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix,
                       PATHSPEC_PREFER_FULL,
                       prefix, argv);
 
-       if (read_cache_preload(pathspec.raw) < 0)
+       if (read_cache_preload(&pathspec) < 0)
                die(_("index file corrupt"));
 
        if (interactive) {
@@ -1241,11 +1241,12 @@ int cmd_status(int argc, const char **argv, const char *prefix)
        handle_untracked_files_arg(&s);
        if (show_ignored_in_status)
                s.show_ignored_files = 1;
-       if (*argv)
-               s.pathspec = get_pathspec(prefix, argv);
+       parse_pathspec(&s.pathspec, 0,
+                      PATHSPEC_PREFER_FULL,
+                      prefix, argv);
 
-       read_cache_preload(s.pathspec);
-       refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, s.pathspec, NULL, NULL);
+       read_cache_preload(&s.pathspec);
+       refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, s.pathspec.raw, NULL, NULL);
 
        fd = hold_locked_index(&index_lock, 0);
        if (0 <= fd)