Make git-repo-config a builtin
authorMatthias Kestenholz <matthias@spinlock.ch>
Wed, 2 Aug 2006 21:51:59 +0000 (23:51 +0200)
committerJunio C Hamano <junkio@cox.net>
Thu, 3 Aug 2006 00:05:14 +0000 (17:05 -0700)
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Makefile
builtin-repo-config.c [moved from repo-config.c with 98% similarity]
builtin.h
git.c

index fd45cd19b134a8a1c104d110be4bab985c048f0a..700c77f5643f9250fc8b41371071bc9871294fb3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -185,7 +185,7 @@ PROGRAMS = \
        git-unpack-objects$X git-update-server-info$X \
        git-upload-pack$X git-verify-pack$X \
        git-symbolic-ref$X \
-       git-name-rev$X git-pack-redundant$X git-repo-config$X git-var$X \
+       git-name-rev$X git-pack-redundant$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-update-ref$X \
@@ -197,7 +197,8 @@ BUILT_INS = git-log$X git-whatchanged$X git-show$X git-update-ref$X \
        git-read-tree$X git-commit-tree$X git-write-tree$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-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
 
 # what 'all' will build and 'install' will install, in gitexecdir
 ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
@@ -254,7 +255,7 @@ BUILTIN_OBJS = \
        builtin-diff-index.o builtin-diff-stages.o builtin-diff-tree.o \
        builtin-cat-file.o builtin-mailsplit.o builtin-stripspace.o \
        builtin-update-ref.o builtin-fmt-merge-msg.o builtin-prune.o \
-       builtin-mv.o builtin-prune-packed.o
+       builtin-mv.o builtin-prune-packed.o builtin-repo-config.o
 
 GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
 LIBS = $(GITLIBS) -lz
similarity index 98%
rename from repo-config.c
rename to builtin-repo-config.c
index 743f02b7de7b3b819d3db29ddfcdcf8ebacaccc4..c821e22717e35795b74f1c26d16f6c7da63ebdf8 100644 (file)
@@ -1,3 +1,4 @@
+#include "builtin.h"
 #include "cache.h"
 #include <regex.h>
 
@@ -128,7 +129,7 @@ free_strings:
        return ret;
 }
 
-int main(int argc, const char **argv)
+int cmd_repo_config(int argc, const char **argv, const char *prefix)
 {
        int nongit = 0;
        setup_git_directory_gently(&nongit);
index 7ddfe2891cfa7104d59960c3b1427b742716dc7d..26ebcaf213111724e8131e9edc8eeb8672e8071e 100644 (file)
--- a/builtin.h
+++ b/builtin.h
@@ -48,6 +48,7 @@ extern int cmd_update_index(int argc, const char **argv, const char *prefix);
 extern int cmd_update_ref(int argc, const char **argv, const char *prefix);
 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_repo_config(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);
diff --git a/git.c b/git.c
index 5b50762de179607df488feb2becd531ee3d3fea6..6e72a893b71129702551eca56c8221110286f14d 100644 (file)
--- a/git.c
+++ b/git.c
@@ -264,6 +264,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
                { "prune", cmd_prune, NEEDS_PREFIX },
                { "mv", cmd_mv, NEEDS_PREFIX },
                { "prune-packed", cmd_prune_packed, NEEDS_PREFIX },
+               { "repo-config", cmd_repo_config },
        };
        int i;