Skip to content
/ git Public
forked from git/git

Commit

Permalink
Make fsck and fsck-objects be builtins.
Browse files Browse the repository at this point in the history
The earlier change df391b1 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>
  • Loading branch information
distorted-mdw authored and Junio C Hamano committed Jan 29, 2007
1 parent dbaa06a commit b4dfefe
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
3 changes: 1 addition & 2 deletions fsck.c → builtin-fsck.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
1 change: 1 addition & 0 deletions builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions git.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down

0 comments on commit b4dfefe

Please sign in to comment.