提交 f81daefe 编写于 作者: T Timo Hirvonen 提交者: Junio C Hamano

Builtin git-cat-file

Signed-off-by: NTimo Hirvonen <tihirvon@gmail.com>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 d48f7168
...@@ -149,7 +149,6 @@ SIMPLE_PROGRAMS = \ ...@@ -149,7 +149,6 @@ SIMPLE_PROGRAMS = \
# ... and all the rest that could be moved out of bindir to gitexecdir # ... and all the rest that could be moved out of bindir to gitexecdir
PROGRAMS = \ PROGRAMS = \
git-cat-file$X \
git-checkout-index$X git-clone-pack$X \ git-checkout-index$X git-clone-pack$X \
git-convert-objects$X git-fetch-pack$X git-fsck-objects$X \ git-convert-objects$X git-fetch-pack$X git-fsck-objects$X \
git-hash-object$X git-index-pack$X git-local-fetch$X \ git-hash-object$X git-index-pack$X git-local-fetch$X \
...@@ -174,7 +173,7 @@ BUILT_INS = git-log$X git-whatchanged$X git-show$X \ ...@@ -174,7 +173,7 @@ BUILT_INS = git-log$X git-whatchanged$X git-show$X \
git-ls-files$X git-ls-tree$X \ git-ls-files$X git-ls-tree$X \
git-read-tree$X git-commit-tree$X \ git-read-tree$X git-commit-tree$X \
git-apply$X git-show-branch$X git-diff-files$X \ git-apply$X git-show-branch$X git-diff-files$X \
git-diff-index$X git-diff-stages$X git-diff-tree$X git-diff-index$X git-diff-stages$X git-diff-tree$X git-cat-file$X
# what 'all' will build and 'install' will install, in gitexecdir # what 'all' will build and 'install' will install, in gitexecdir
ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS) ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
...@@ -228,7 +227,8 @@ BUILTIN_OBJS = \ ...@@ -228,7 +227,8 @@ BUILTIN_OBJS = \
builtin-ls-files.o builtin-ls-tree.o \ builtin-ls-files.o builtin-ls-tree.o \
builtin-read-tree.o builtin-commit-tree.o \ builtin-read-tree.o builtin-commit-tree.o \
builtin-apply.o builtin-show-branch.o builtin-diff-files.o \ builtin-apply.o builtin-show-branch.o builtin-diff-files.o \
builtin-diff-index.o builtin-diff-stages.o builtin-diff-tree.o builtin-diff-index.o builtin-diff-stages.o builtin-diff-tree.o \
builtin-cat-file.o
GITLIBS = $(LIB_FILE) $(XDIFF_LIB) GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
LIBS = $(GITLIBS) -lz LIBS = $(GITLIBS) -lz
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "exec_cmd.h" #include "exec_cmd.h"
#include "tag.h" #include "tag.h"
#include "tree.h" #include "tree.h"
#include "builtin.h"
static void flush_buffer(const char *buf, unsigned long size) static void flush_buffer(const char *buf, unsigned long size)
{ {
...@@ -93,7 +94,7 @@ static int pprint_tag(const unsigned char *sha1, const char *buf, unsigned long ...@@ -93,7 +94,7 @@ static int pprint_tag(const unsigned char *sha1, const char *buf, unsigned long
return 0; return 0;
} }
int main(int argc, char **argv) int cmd_cat_file(int argc, const char **argv, char **envp)
{ {
unsigned char sha1[20]; unsigned char sha1[20];
char type[20]; char type[20];
......
...@@ -42,5 +42,6 @@ extern int cmd_diff_files(int argc, const char **argv, char **envp); ...@@ -42,5 +42,6 @@ extern int cmd_diff_files(int argc, const char **argv, char **envp);
extern int cmd_diff_index(int argc, const char **argv, char **envp); extern int cmd_diff_index(int argc, const char **argv, char **envp);
extern int cmd_diff_stages(int argc, const char **argv, char **envp); extern int cmd_diff_stages(int argc, const char **argv, char **envp);
extern int cmd_diff_tree(int argc, const char **argv, char **envp); extern int cmd_diff_tree(int argc, const char **argv, char **envp);
extern int cmd_cat_file(int argc, const char **argv, char **envp);
#endif #endif
...@@ -68,7 +68,8 @@ static void handle_internal_command(int argc, const char **argv, char **envp) ...@@ -68,7 +68,8 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
{ "diff-files", cmd_diff_files }, { "diff-files", cmd_diff_files },
{ "diff-index", cmd_diff_index }, { "diff-index", cmd_diff_index },
{ "diff-stages", cmd_diff_stages }, { "diff-stages", cmd_diff_stages },
{ "diff-tree", cmd_diff_tree } { "diff-tree", cmd_diff_tree },
{ "cat-file", cmd_cat_file }
}; };
int i; int i;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册