]> asedeno.scripts.mit.edu Git - git.git/blobdiff - builtin-commit.c
Make some of fwrite/fclose/write/close failures visible
[git.git] / builtin-commit.c
index 591d16b91eab09d89fefecbd058e4bca78439455..2b499fa543e4fd969ee0dcf1e878cbe19f4ba02f 100644 (file)
@@ -225,18 +225,18 @@ static char *prepare_index(int argc, const char **argv, const char *prefix)
 
        if (interactive) {
                interactive_add(argc, argv, prefix);
-               if (read_cache() < 0)
+               if (read_cache_preload(NULL) < 0)
                        die("index file corrupt");
                commit_style = COMMIT_AS_IS;
                return get_index_file();
        }
 
-       if (read_cache() < 0)
-               die("index file corrupt");
-
        if (*argv)
                pathspec = get_pathspec(prefix, argv);
 
+       if (read_cache_preload(pathspec) < 0)
+               die("index file corrupt");
+
        /*
         * Non partial, non as-is commit.
         *
@@ -639,7 +639,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
                active_cache_tree = cache_tree();
        if (cache_tree_update(active_cache_tree,
                              active_cache, active_nr, 0, 0) < 0) {
-               error("Error building trees; the index is unmerged?");
+               error("Error building trees");
                return 0;
        }