@matheusbsbs / matheus-bagliano / commits / 6d96ac18e5
Fork 0

Builtin git-commit-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 6d96ac18e52aca19ff1087ffa64e2d616cc75c6f
4 files changed +9 -6
Makefile
+3 -3
@@ -150,7 +150,7 @@ SIMPLE_PROGRAMS = \
150 # ... and all the rest that could be moved out of bindir to gitexecdir
151 PROGRAMS = \
152 git-apply$X git-cat-file$X \
153 - git-checkout-index$X git-clone-pack$X git-commit-tree$X \
153 + git-checkout-index$X git-clone-pack$X \
154 git-convert-objects$X git-diff-files$X \
155 git-diff-index$X git-diff-stages$X \
156 git-diff-tree$X git-fetch-pack$X git-fsck-objects$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 git-read-tree$X
175 + git-tar-tree$X git-read-tree$X git-commit-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 builtin-read-tree.o
225 + builtin-tar-tree.o builtin-read-tree.o builtin-commit-tree.o
226
227 GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
228 LIBS = $(GITLIBS) -lz
builtin-commit-tree.c renamed
+3 -2
@@ -6,6 +6,7 @@
6 #include "cache.h"
7 #include "commit.h"
8 #include "tree.h"
9 +#include "builtin.h"
10
11 #define BLOCKING (1ul << 14)
12
@@ -76,7 +77,7 @@ static int new_parent(int idx)
77 return 1;
78 }
79
79 -int main(int argc, char **argv)
80 +int cmd_commit_tree(int argc, const char **argv, char **envp)
81 {
82 int i;
83 int parents = 0;
@@ -98,7 +99,7 @@ int main(int argc, char **argv)
99
100 check_valid(tree_sha1, tree_type);
101 for (i = 2; i < argc; i += 2) {
101 - char *a, *b;
102 + const char *a, *b;
103 a = argv[i]; b = argv[i+1];
104 if (!b || strcmp(a, "-p"))
105 usage(commit_tree_usage);
builtin.h
+1
@@ -31,5 +31,6 @@ 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 +extern int cmd_commit_tree(int argc, const char **argv, char **envp);
35
36 #endif
git.c
+2 -1
@@ -56,7 +56,8 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
56 { "ls-files", cmd_ls_files },
57 { "ls-tree", cmd_ls_tree },
58 { "tar-tree", cmd_tar_tree },
59 - { "read-tree", cmd_read_tree }
59 + { "read-tree", cmd_read_tree },
60 + { "commit-tree", cmd_commit_tree }
61 };
62 int i;
63