aboutsummaryrefslogtreecommitdiff
path: root/perl/Git.xs
diff options
context:
space:
mode:
authorPetr Baudis <pasky@suse.cz>2006-06-24 04:34:34 +0200
committerJunio C Hamano <junkio@cox.net>2006-07-02 17:14:40 -0700
commit8062f81c2d9df5e6552bf267b258ffcc5f647f93 (patch)
tree8a04b8e74fbf4ffcb334a38ba5119e9d494f47cc /perl/Git.xs
parenteca1f6fdb862e6ca07288ac385725c95fd96490e (diff)
downloadgit-8062f81c2d9df5e6552bf267b258ffcc5f647f93.tar.gz
git-8062f81c2d9df5e6552bf267b258ffcc5f647f93.tar.xz
Git.pm: Call external commands using execv_git_cmd()
Instead of explicitly using the git wrapper to call external commands, use the execv_git_cmd() function which will directly call whatever needs to be called. GitBin option becomes useless so drop it. This actually means the exec_path() thing I planned to use worthless internally, but Jakub wants it in anyway and I don't mind, so... Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'perl/Git.xs')
-rw-r--r--perl/Git.xs22
1 files changed, 22 insertions, 0 deletions
diff --git a/perl/Git.xs b/perl/Git.xs
index 9e754d253..6478f9c77 100644
--- a/perl/Git.xs
+++ b/perl/Git.xs
@@ -33,6 +33,28 @@ OUTPUT:
RETVAL
+void
+xs__execv_git_cmd(...)
+CODE:
+{
+ const char **argv;
+ int i;
+
+ argv = malloc(sizeof(const char *) * (items + 1));
+ if (!argv)
+ croak("malloc failed");
+ for (i = 0; i < items; i++)
+ argv[i] = strdup(SvPV_nolen(ST(i)));
+ argv[i] = NULL;
+
+ execv_git_cmd(argv);
+
+ for (i = 0; i < items; i++)
+ if (argv[i])
+ free((char *) argv[i]);
+ free((char **) argv);
+}
+
char *
xs_hash_object(file, type = "blob")
SV *file;