Builtin git-tar-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
56d1398ad305498faf57d6e433f97ad393d7909e
4 files changed
+10
-5
Makefile
+5
-3
@@ -161,7 +161,7 @@ PROGRAMS = \
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 \
164
- git-ssh-upload$X git-tar-tree$X git-unpack-file$X \
164
+ git-ssh-upload$X git-unpack-file$X \
165
git-unpack-objects$X git-update-index$X git-update-server-info$X \
166
git-upload-pack$X git-verify-pack$X git-write-tree$X \
167
git-update-ref$X git-symbolic-ref$X \
@@ -171,7 +171,8 @@ PROGRAMS = \
171
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
174
+ git-init-db$X git-ls-files$X git-ls-tree$X \
175
+ git-tar-tree$X
176
177
# what 'all' will build and 'install' will install, in gitexecdir
178
ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
@@ -220,7 +221,8 @@ LIB_OBJS = \
221
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 \
223
- builtin-init-db.o builtin-ls-files.o builtin-ls-tree.o
224
+ builtin-init-db.o builtin-ls-files.o builtin-ls-tree.o \
225
+ builtin-tar-tree.o
226
227
GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
228
LIBS = $(GITLIBS) -lz
builtin-tar-tree.c
renamed
+2
-1
@@ -7,6 +7,7 @@
7
#include "commit.h"
8
#include "strbuf.h"
9
#include "tar.h"
10
+#include "builtin.h"
11
12
#define RECORDSIZE (512)
13
#define BLOCKSIZE (RECORDSIZE * 20)
@@ -301,7 +302,7 @@ static void traverse_tree(struct tree_desc *tree, struct strbuf *path)
302
}
303
}
304
304
-int main(int argc, char **argv)
305
+int cmd_tar_tree(int argc, const char **argv, char** envp)
306
{
307
unsigned char sha1[20], tree_sha1[20];
308
struct commit *commit;
builtin.h
+1
@@ -29,5 +29,6 @@ extern int cmd_check_ref_format(int argc, const char **argv, char **envp);
29
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
34
#endif
git.c
+2
-1
@@ -54,7 +54,8 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
54
{ "init-db", cmd_init_db },
55
{ "check-ref-format", cmd_check_ref_format },
56
{ "ls-files", cmd_ls_files },
57
- { "ls-tree", cmd_ls_tree }
57
+ { "ls-tree", cmd_ls_tree },
58
+ { "tar-tree", cmd_tar_tree }
59
};
60
int i;
61