@matheusbsbs / matheus-bagliano / commits / 9370bae2ce
Fork 0

Make git-check-format-ref a builtin.

Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se> Signed-off-by: Junio C Hamano <junkio@cox.net>

Lukas Sandström committed May 18, 2006 at 14:15 UTC 9370bae2cef351617272aa142fbe4ce039833d13
5 files changed +19 -20
Makefile
+3 -3
@@ -164,13 +164,13 @@ PROGRAMS = \
164 git-ssh-upload$X git-tar-tree$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 git-check-ref-format$X \
167 + git-update-ref$X git-symbolic-ref$X \
168 git-name-rev$X git-pack-redundant$X git-repo-config$X git-var$X \
169 git-describe$X git-merge-tree$X git-blame$X git-imap-send$X
170
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
173 + git-grep$X git-rev-list$X git-check-ref-format$X
174
175 # what 'all' will build and 'install' will install, in gitexecdir
176 ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
@@ -218,7 +218,7 @@ LIB_OBJS = \
218
219 BUILTIN_OBJS = \
220 builtin-log.o builtin-help.o builtin-count.o builtin-diff.o builtin-push.o \
221 - builtin-grep.o builtin-rev-list.o
221 + builtin-grep.o builtin-rev-list.o builtin-check-ref-format.o
222
223 GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
224 LIBS = $(GITLIBS) -lz
builtin-check-ref-format.c new
+14
@@ -0,0 +1,14 @@
1 +/*
2 + * GIT - The information manager from hell
3 + */
4 +
5 +#include "cache.h"
6 +#include "refs.h"
7 +#include "builtin.h"
8 +
9 +int cmd_check_ref_format(int argc, const char **argv, char **envp)
10 +{
11 + if (argc != 2)
12 + usage("git check-ref-format refname");
13 + return !!check_ref_format(argv[1]);
14 +}
builtin.h
+1
@@ -25,5 +25,6 @@ extern int cmd_count_objects(int argc, const char **argv, char **envp);
25 extern int cmd_push(int argc, const char **argv, char **envp);
26 extern int cmd_grep(int argc, const char **argv, char **envp);
27 extern int cmd_rev_list(int argc, const char **argv, char **envp);
28 +extern int cmd_check_ref_format(int argc, const char **argv, char **envp);
29
30 #endif
check-ref-format.c deleted
-17
@@ -1,17 +0,0 @@
1 -/*
2 - * GIT - The information manager from hell
3 - */
4 -
5 -#include "cache.h"
6 -#include "refs.h"
7 -
8 -#include <stdio.h>
9 -
10 -int main(int ac, char **av)
11 -{
12 - if (ac != 2)
13 - usage("git-check-ref-format refname");
14 - if (check_ref_format(av[1]))
15 - exit(1);
16 - return 0;
17 -}
git.c
+1
@@ -51,6 +51,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
51 { "diff", cmd_diff },
52 { "grep", cmd_grep },
53 { "rev-list", cmd_rev_list },
54 + { "check-ref-format", cmd_check_ref_format }
55 };
56 int i;
57