Skip to content

Commit

Permalink
Builtin git-apply.
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Peter Eriksen authored and Junio C Hamano committed May 23, 2006
1 parent 6d96ac1 commit ac6245e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ SIMPLE_PROGRAMS = \

# ... and all the rest that could be moved out of bindir to gitexecdir
PROGRAMS = \
git-apply$X git-cat-file$X \
git-cat-file$X \
git-checkout-index$X git-clone-pack$X \
git-convert-objects$X git-diff-files$X \
git-diff-index$X git-diff-stages$X \
Expand All @@ -172,7 +172,8 @@ BUILT_INS = git-log$X git-whatchanged$X git-show$X \
git-count-objects$X git-diff$X git-push$X \
git-grep$X git-rev-list$X git-check-ref-format$X \
git-init-db$X git-ls-files$X git-ls-tree$X \
git-tar-tree$X git-read-tree$X git-commit-tree$X
git-tar-tree$X git-read-tree$X git-commit-tree$X \
git-apply$X

# what 'all' will build and 'install' will install, in gitexecdir
ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
Expand Down Expand Up @@ -222,7 +223,8 @@ BUILTIN_OBJS = \
builtin-log.o builtin-help.o builtin-count.o builtin-diff.o builtin-push.o \
builtin-grep.o builtin-rev-list.o builtin-check-ref-format.o \
builtin-init-db.o builtin-ls-files.o builtin-ls-tree.o \
builtin-tar-tree.o builtin-read-tree.o builtin-commit-tree.o
builtin-tar-tree.o builtin-read-tree.o builtin-commit-tree.o \
builtin-apply.o

GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
LIBS = $(GITLIBS) -lz
Expand Down
3 changes: 2 additions & 1 deletion apply.c → builtin-apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "quote.h"
#include "blob.h"
#include "delta.h"
#include "builtin.h"

// --check turns on checking that the working tree matches the
// files that are being modified, but doesn't apply the patch
Expand Down Expand Up @@ -2151,7 +2152,7 @@ static int git_apply_config(const char *var, const char *value)
}


int main(int argc, char **argv)
int cmd_apply(int argc, const char **argv, char **envp)
{
int i;
int read_stdin = 1;
Expand Down
1 change: 1 addition & 0 deletions builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ extern int cmd_ls_tree(int argc, const char **argv, char **envp);
extern int cmd_tar_tree(int argc, const char **argv, char **envp);
extern int cmd_read_tree(int argc, const char **argv, char **envp);
extern int cmd_commit_tree(int argc, const char **argv, char **envp);
extern int cmd_apply(int argc, const char **argv, char **envp);

#endif
3 changes: 2 additions & 1 deletion git.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
{ "ls-tree", cmd_ls_tree },
{ "tar-tree", cmd_tar_tree },
{ "read-tree", cmd_read_tree },
{ "commit-tree", cmd_commit_tree }
{ "commit-tree", cmd_commit_tree },
{ "apply", cmd_apply }
};
int i;

Expand Down

0 comments on commit ac6245e

Please sign in to comment.