[PATCH 11/13] Move bundle specific stuff into bundle.[ch]

Previous thread: [PATCH 13/13] Make fetch a builtin by Daniel Barkalow on Monday, September 10, 2007 - 11:03 pm. (1 message)

Next thread: [PATCH 12/13] Add bundle transport by Johannes Schindelin on Monday, September 10, 2007 - 11:03 pm. (7 messages)
To: Junio C Hamano <junkio@...>
Cc: <git@...>
Date: Monday, September 10, 2007 - 11:03 pm

The transport specific stuff was moved into libgit.a, and the
bundle specific stuff will not be left behind.

This is a big code move, with one exception: the function
unbundle() no longer outputs the list of refs. You have to call
list_bundle_refs() yourself for that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
Makefile | 2 +-
builtin-bundle.c | 365 +-----------------------------------------
builtin-bundle.c => bundle.c | 87 +---------
bundle.h | 25 +++
4 files changed, 39 insertions(+), 440 deletions(-)
copy builtin-bundle.c => bundle.c (79%)
create mode 100644 bundle.h

diff --git a/Makefile b/Makefile
index a478c85..8cfcfa7 100644
--- a/Makefile
+++ b/Makefile
@@ -306,7 +306,7 @@ LIB_OBJS = \
alloc.o merge-file.o path-list.o help.o unpack-trees.o $(DIFF_OBJS) \
color.o wt-status.o archive-zip.o archive-tar.o shallow.o utf8.o \
convert.o attr.o decorate.o progress.o mailmap.o symlinks.o remote.o \
- transport.o
+ transport.o bundle.o

BUILTIN_OBJS = \
builtin-add.o \
diff --git a/builtin-bundle.c b/builtin-bundle.c
index 1b65006..9f38e21 100644
--- a/builtin-bundle.c
+++ b/builtin-bundle.c
@@ -1,11 +1,6 @@
#include "builtin.h"
#include "cache.h"
-#include "object.h"
-#include "commit.h"
-#include "diff.h"
-#include "revision.h"
-#include "list-objects.h"
-#include "run-command.h"
+#include "bundle.h"

/*
* Basic handler for bundle files to connect repositories via sneakernet.
@@ -16,355 +11,6 @@

static const char *bundle_usage="git-bundle (create <bundle> <git-rev-list args> | verify <bundle> | list-heads <bundle> [refname]... | unbundle <bundle> [refname]... )";

-static const char bundle_signature[] = "# v2 git bundle\n";
-
-struct ref_list {
- unsigned int nr, alloc;
- struct ref_list_entry {
- unsigned char sha1[20];
- char *name;
- } *list;
-};
-
-static void add_to_ref_list(const unsigned c...

Previous thread: [PATCH 13/13] Make fetch a builtin by Daniel Barkalow on Monday, September 10, 2007 - 11:03 pm. (1 message)

Next thread: [PATCH 12/13] Add bundle transport by Johannes Schindelin on Monday, September 10, 2007 - 11:03 pm. (7 messages)