@matheusbsbs / matheus-bagliano / commits / d147e501f3
Fork 0

Builtin git-read-tree.

Signed-off-by: Peter Eriksen <s022018@student.dtu.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>

Peter Eriksen committed May 23, 2006 at 14:15 UTC d147e501f37a596e73a430ce46f125f83e06aa07
4 files changed +8 -5
Makefile
+3 -3
@@ -157,7 +157,7 @@ PROGRAMS = \
157 git-hash-object$X git-index-pack$X git-local-fetch$X \
158 git-mailinfo$X git-merge-base$X \
159 git-merge-index$X git-mktag$X git-mktree$X git-pack-objects$X git-patch-id$X \
160 - git-peek-remote$X git-prune-packed$X git-read-tree$X \
160 + git-peek-remote$X git-prune-packed$X \
161 git-receive-pack$X git-rev-parse$X \
162 git-send-pack$X git-show-branch$X git-shell$X \
163 git-show-index$X git-ssh-fetch$X \
@@ -172,7 +172,7 @@ BUILT_INS = git-log$X git-whatchanged$X git-show$X \
172 git-count-objects$X git-diff$X git-push$X \
173 git-grep$X git-rev-list$X git-check-ref-format$X \
174 git-init-db$X git-ls-files$X git-ls-tree$X \
175 - git-tar-tree$X
175 + git-tar-tree$X git-read-tree$X
176
177 # what 'all' will build and 'install' will install, in gitexecdir
178 ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
@@ -222,7 +222,7 @@ BUILTIN_OBJS = \
222 builtin-log.o builtin-help.o builtin-count.o builtin-diff.o builtin-push.o \
223 builtin-grep.o builtin-rev-list.o builtin-check-ref-format.o \
224 builtin-init-db.o builtin-ls-files.o builtin-ls-tree.o \
225 - builtin-tar-tree.o
225 + builtin-tar-tree.o builtin-read-tree.o
226
227 GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
228 LIBS = $(GITLIBS) -lz
builtin-read-tree.c renamed
+2 -1
@@ -11,6 +11,7 @@
11 #include "tree.h"
12 #include <sys/time.h>
13 #include <signal.h>
14 +#include "builtin.h"
15
16 static int reset = 0;
17 static int merge = 0;
@@ -763,7 +764,7 @@ static const char read_tree_usage[] = "git-read-tree (<sha> | -m [--aggressive]
764
765 static struct cache_file cache_file;
766
766 -int main(int argc, char **argv)
767 +int cmd_read_tree(int argc, const char **argv, char **envp)
768 {
769 int i, newfd, stage = 0;
770 unsigned char sha1[20];
builtin.h
+1
@@ -30,5 +30,6 @@ extern int cmd_init_db(int argc, const char **argv, char **envp);
30 extern int cmd_ls_files(int argc, const char **argv, char **envp);
31 extern int cmd_ls_tree(int argc, const char **argv, char **envp);
32 extern int cmd_tar_tree(int argc, const char **argv, char **envp);
33 +extern int cmd_read_tree(int argc, const char **argv, char **envp);
34
35 #endif
git.c
+2 -1
@@ -55,7 +55,8 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
55 { "check-ref-format", cmd_check_ref_format },
56 { "ls-files", cmd_ls_files },
57 { "ls-tree", cmd_ls_tree },
58 - { "tar-tree", cmd_tar_tree }
58 + { "tar-tree", cmd_tar_tree },
59 + { "read-tree", cmd_read_tree }
60 };
61 int i;
62