Make git-pack-objects a builtin
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
d6b64ed0f3
commit
5d4a600335
6
Makefile
6
Makefile
@ -177,7 +177,7 @@ PROGRAMS = \
|
|||||||
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 \
|
||||||
git-merge-base$X \
|
git-merge-base$X \
|
||||||
git-merge-index$X git-mktag$X git-mktree$X git-pack-objects$X git-patch-id$X \
|
git-merge-index$X git-mktag$X git-mktree$X git-patch-id$X \
|
||||||
git-peek-remote$X git-receive-pack$X \
|
git-peek-remote$X git-receive-pack$X \
|
||||||
git-send-pack$X git-shell$X \
|
git-send-pack$X git-shell$X \
|
||||||
git-show-index$X git-ssh-fetch$X \
|
git-show-index$X git-ssh-fetch$X \
|
||||||
@ -198,7 +198,7 @@ BUILT_INS = git-log$X git-whatchanged$X git-show$X git-update-ref$X \
|
|||||||
git-apply$X git-show-branch$X git-diff-files$X git-update-index$X \
|
git-apply$X git-show-branch$X git-diff-files$X git-update-index$X \
|
||||||
git-diff-index$X git-diff-stages$X git-diff-tree$X git-cat-file$X \
|
git-diff-index$X git-diff-stages$X git-diff-tree$X git-cat-file$X \
|
||||||
git-fmt-merge-msg$X git-prune$X git-mv$X git-prune-packed$X \
|
git-fmt-merge-msg$X git-prune$X git-mv$X git-prune-packed$X \
|
||||||
git-repo-config$X git-name-rev$X
|
git-repo-config$X git-name-rev$X git-pack-objects$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)
|
||||||
@ -256,7 +256,7 @@ BUILTIN_OBJS = \
|
|||||||
builtin-cat-file.o builtin-mailsplit.o builtin-stripspace.o \
|
builtin-cat-file.o builtin-mailsplit.o builtin-stripspace.o \
|
||||||
builtin-update-ref.o builtin-fmt-merge-msg.o builtin-prune.o \
|
builtin-update-ref.o builtin-fmt-merge-msg.o builtin-prune.o \
|
||||||
builtin-mv.o builtin-prune-packed.o builtin-repo-config.o \
|
builtin-mv.o builtin-prune-packed.o builtin-repo-config.o \
|
||||||
builtin-name-rev.o
|
builtin-name-rev.o builtin-pack-objects.o
|
||||||
|
|
||||||
GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
|
GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
|
||||||
LIBS = $(GITLIBS) -lz
|
LIBS = $(GITLIBS) -lz
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include "builtin.h"
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
#include "blob.h"
|
#include "blob.h"
|
||||||
@ -1226,7 +1227,7 @@ static int git_pack_config(const char *k, const char *v)
|
|||||||
return git_default_config(k, v);
|
return git_default_config(k, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_pack_objects(int argc, const char **argv, const char *prefix)
|
||||||
{
|
{
|
||||||
SHA_CTX ctx;
|
SHA_CTX ctx;
|
||||||
char line[40 + 1 + PATH_MAX + 2];
|
char line[40 + 1 + PATH_MAX + 2];
|
||||||
@ -1235,7 +1236,6 @@ int main(int argc, char **argv)
|
|||||||
int num_preferred_base = 0;
|
int num_preferred_base = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
setup_git_directory();
|
|
||||||
git_config(git_pack_config);
|
git_config(git_pack_config);
|
||||||
|
|
||||||
progress = isatty(2);
|
progress = isatty(2);
|
@ -50,6 +50,7 @@ extern int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix);
|
|||||||
extern int cmd_mv(int argc, const char **argv, const char *prefix);
|
extern int cmd_mv(int argc, const char **argv, const char *prefix);
|
||||||
extern int cmd_repo_config(int argc, const char **argv, const char *prefix);
|
extern int cmd_repo_config(int argc, const char **argv, const char *prefix);
|
||||||
extern int cmd_name_rev(int argc, const char **argv, const char *prefix);
|
extern int cmd_name_rev(int argc, const char **argv, const char *prefix);
|
||||||
|
extern int cmd_pack_objects(int argc, const char **argv, const char *prefix);
|
||||||
|
|
||||||
extern int cmd_write_tree(int argc, const char **argv, const char *prefix);
|
extern int cmd_write_tree(int argc, const char **argv, const char *prefix);
|
||||||
extern int write_tree(unsigned char *sha1, int missing_ok, const char *prefix);
|
extern int write_tree(unsigned char *sha1, int missing_ok, const char *prefix);
|
||||||
|
1
git.c
1
git.c
@ -266,6 +266,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
|
|||||||
{ "prune-packed", cmd_prune_packed, NEEDS_PREFIX },
|
{ "prune-packed", cmd_prune_packed, NEEDS_PREFIX },
|
||||||
{ "repo-config", cmd_repo_config },
|
{ "repo-config", cmd_repo_config },
|
||||||
{ "name-rev", cmd_name_rev, NEEDS_PREFIX },
|
{ "name-rev", cmd_name_rev, NEEDS_PREFIX },
|
||||||
|
{ "pack-objects", cmd_pack_objects, NEEDS_PREFIX },
|
||||||
};
|
};
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user