@matheusbsbs / matheus-bagliano / commits / 640ce1052b
Fork 0

Make git-symbolic-ref a builtin

Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch> Signed-off-by: Junio C Hamano <junkio@cox.net>

Matthias Kestenholz committed Aug 3, 2006 at 17:24 UTC 640ce1052bbd6a8f1dd4d58beaa521d7592a0f02
4 files changed +7 -5
Makefile
+3 -3
@@ -184,7 +184,6 @@ PROGRAMS = \
184 git-ssh-upload$X git-unpack-file$X \
185 git-update-server-info$X \
186 git-upload-pack$X git-verify-pack$X \
187 - git-symbolic-ref$X \
187 git-pack-redundant$X git-var$X \
188 git-describe$X git-merge-tree$X git-blame$X git-imap-send$X
189
@@ -199,7 +198,7 @@ BUILT_INS = git-log$X git-whatchanged$X git-show$X git-update-ref$X \
198 git-diff-index$X git-diff-stages$X git-diff-tree$X git-cat-file$X \
199 git-fmt-merge-msg$X git-prune$X git-mv$X git-prune-packed$X \
200 git-repo-config$X git-name-rev$X git-pack-objects$X \
202 - git-unpack-objects$X
201 + git-unpack-objects$X git-symbolic-ref$X
202
203 # what 'all' will build and 'install' will install, in gitexecdir
204 ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
@@ -257,7 +256,8 @@ BUILTIN_OBJS = \
256 builtin-cat-file.o builtin-mailsplit.o builtin-stripspace.o \
257 builtin-update-ref.o builtin-fmt-merge-msg.o builtin-prune.o \
258 builtin-mv.o builtin-prune-packed.o builtin-repo-config.o \
260 - builtin-name-rev.o builtin-pack-objects.o builtin-unpack-objects.o
259 + builtin-name-rev.o builtin-pack-objects.o builtin-unpack-objects.o \
260 + builtin-symbolic-ref.o
261
262 GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
263 LIBS = $(GITLIBS) -lz
builtin-symbolic-ref.c renamed
+2 -2
@@ -1,3 +1,4 @@
1 +#include "builtin.h"
2 #include "cache.h"
3
4 static const char git_symbolic_ref_usage[] =
@@ -17,9 +18,8 @@ static void check_symref(const char *HEAD)
18 die("No such ref: %s", HEAD);
19 }
20
20 -int main(int argc, const char **argv)
21 +int cmd_symbolic_ref(int argc, const char **argv, const char *prefix)
22 {
22 - setup_git_directory();
23 git_config(git_default_config);
24 switch (argc) {
25 case 2:
builtin.h
+1
@@ -52,6 +52,7 @@ extern int cmd_repo_config(int argc, const char **argv, const char *prefix);
52 extern int cmd_name_rev(int argc, const char **argv, const char *prefix);
53 extern int cmd_pack_objects(int argc, const char **argv, const char *prefix);
54 extern int cmd_unpack_objects(int argc, const char **argv, const char *prefix);
55 +extern int cmd_symbolic_ref(int argc, const char **argv, const char *prefix);
56
57 extern int cmd_write_tree(int argc, const char **argv, const char *prefix);
58 extern int write_tree(unsigned char *sha1, int missing_ok, const char *prefix);
git.c
+1
@@ -268,6 +268,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
268 { "name-rev", cmd_name_rev, NEEDS_PREFIX },
269 { "pack-objects", cmd_pack_objects, NEEDS_PREFIX },
270 { "unpack-objects", cmd_unpack_objects, NEEDS_PREFIX },
271 + { "symbolic-ref", cmd_symbolic_ref, NEEDS_PREFIX },
272 };
273 int i;
274