sha1-name.c: remove implicit dependency on the_index
[gitweb.git] / builtin / describe.c
index 22c0541da552c8135e21a6f3c9d3f7829fc0d31a..bc97e50650a39e03448c1c4e5dd0e8f880b9befc 100644 (file)
@@ -488,7 +488,7 @@ static void describe_blob(struct object_id oid, struct strbuf *dst)
                "--objects", "--in-commit-order", "--reverse", "HEAD",
                NULL);
 
-       init_revisions(&revs, NULL);
+       repo_init_revisions(the_repository, &revs, NULL);
        if (setup_revisions(args.argc, args.argv, &revs, NULL) > 1)
                BUG("setup_revisions could not handle all args?");
 
@@ -629,14 +629,14 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
                        struct argv_array args = ARGV_ARRAY_INIT;
                        int fd, result;
 
-                       read_cache_preload(NULL);
+                       read_cache();
                        refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED,
                                      NULL, NULL, NULL);
                        fd = hold_locked_index(&index_lock, 0);
                        if (0 <= fd)
-                               update_index_if_able(&the_index, &index_lock);
+                               repo_update_index_if_able(the_repository, &index_lock);
 
-                       init_revisions(&revs, prefix);
+                       repo_init_revisions(the_repository, &revs, prefix);
                        argv_array_pushv(&args, diff_index_args);
                        if (setup_revisions(args.argc, args.argv, &revs, NULL) != 1)
                                BUG("malformed internal diff-index command line");