Skip to content

Commit

Permalink
Make git-check-format-ref a builtin.
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Lukas Sandström authored and Junio C Hamano committed May 18, 2006
1 parent 5fb61b8 commit 9370bae
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 20 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,13 @@ PROGRAMS = \
git-ssh-upload$X git-tar-tree$X git-unpack-file$X \
git-unpack-objects$X git-update-index$X git-update-server-info$X \
git-upload-pack$X git-verify-pack$X git-write-tree$X \
git-update-ref$X git-symbolic-ref$X git-check-ref-format$X \
git-update-ref$X git-symbolic-ref$X \
git-name-rev$X git-pack-redundant$X git-repo-config$X git-var$X \
git-describe$X git-merge-tree$X git-blame$X git-imap-send$X

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-grep$X git-rev-list$X git-check-ref-format$X

# what 'all' will build and 'install' will install, in gitexecdir
ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
Expand Down Expand Up @@ -218,7 +218,7 @@ LIB_OBJS = \

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-grep.o builtin-rev-list.o builtin-check-ref-format.o

GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
LIBS = $(GITLIBS) -lz
Expand Down
14 changes: 14 additions & 0 deletions builtin-check-ref-format.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* GIT - The information manager from hell
*/

#include "cache.h"
#include "refs.h"
#include "builtin.h"

int cmd_check_ref_format(int argc, const char **argv, char **envp)
{
if (argc != 2)
usage("git check-ref-format refname");
return !!check_ref_format(argv[1]);
}
1 change: 1 addition & 0 deletions builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ extern int cmd_count_objects(int argc, const char **argv, char **envp);
extern int cmd_push(int argc, const char **argv, char **envp);
extern int cmd_grep(int argc, const char **argv, char **envp);
extern int cmd_rev_list(int argc, const char **argv, char **envp);
extern int cmd_check_ref_format(int argc, const char **argv, char **envp);

#endif
17 changes: 0 additions & 17 deletions check-ref-format.c

This file was deleted.

1 change: 1 addition & 0 deletions git.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
{ "diff", cmd_diff },
{ "grep", cmd_grep },
{ "rev-list", cmd_rev_list },
{ "check-ref-format", cmd_check_ref_format }
};
int i;

Expand Down

0 comments on commit 9370bae

Please sign in to comment.