Make fsck and fsck-objects be builtins.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 29 Jan 2007 15:48:06 +0000 (15:48 +0000)
committerJunio C Hamano <junkio@cox.net>
Mon, 29 Jan 2007 17:36:21 +0000 (09:36 -0800)
The earlier change df391b192 to rename fsck-objects to fsck broke
fsck-objects.  This should fix it again.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Makefile
builtin-fsck.c [moved from fsck.c with 99% similarity]
builtin.h
git.c

index 1552b2a5308f0a7c73b22f3416d5268e75a23deb..91bd665725ddb8675df755450c441f34efc98ae4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -284,6 +284,7 @@ BUILTIN_OBJS = \
        builtin-diff-tree.o \
        builtin-fmt-merge-msg.o \
        builtin-for-each-ref.o \
+       builtin-fsck.o \
        builtin-grep.o \
        builtin-init-db.o \
        builtin-log.o \
similarity index 99%
rename from fsck.c
rename to builtin-fsck.c
index 558f0a6b349b921802668282e8c2b71b0f03d754..fec1cbd784f598342eb44f385a55dba25a0b9021 100644 (file)
--- a/fsck.c
@@ -571,12 +571,11 @@ static int fsck_cache_tree(struct cache_tree *it)
        return err;
 }
 
-int main(int argc, char **argv)
+int cmd_fsck(int argc, char **argv, const char *prefix)
 {
        int i, heads;
 
        track_object_refs = 1;
-       setup_git_directory();
 
        for (i = 1; i < argc; i++) {
                const char *arg = argv[i];
index cfe5990740b8fd00287cfe747ef83088c98f8754..dd0e3529beba827fe564161aedeb84d78ae32f82 100644 (file)
--- a/builtin.h
+++ b/builtin.h
@@ -34,6 +34,7 @@ extern int cmd_diff_tree(int argc, const char **argv, const char *prefix);
 extern int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix);
 extern int cmd_for_each_ref(int argc, const char **argv, const char *prefix);
 extern int cmd_format_patch(int argc, const char **argv, const char *prefix);
+extern int cmd_fsck(int argc, const char **argv, const char *prefix);
 extern int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix);
 extern int cmd_grep(int argc, const char **argv, const char *prefix);
 extern int cmd_help(int argc, const char **argv, const char *prefix);
diff --git a/git.c b/git.c
index d21e5e505c9622efcfd6eb147a5d4a0528660e0e..fb03a547de16af8d9201dc41e9a6f2e37680688b 100644 (file)
--- a/git.c
+++ b/git.c
@@ -235,6 +235,8 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
                { "fmt-merge-msg", cmd_fmt_merge_msg, RUN_SETUP },
                { "for-each-ref", cmd_for_each_ref, RUN_SETUP },
                { "format-patch", cmd_format_patch, RUN_SETUP },
+               { "fsck", cmd_fsck, RUN_SETUP },
+               { "fsck-objects", cmd_fsck, RUN_SETUP },
                { "get-tar-commit-id", cmd_get_tar_commit_id },
                { "grep", cmd_grep, RUN_SETUP },
                { "help", cmd_help },