summaryrefslogtreecommitdiff
path: root/test-fake-ssh.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2016-04-13 20:22:42 +0700
committerJunio C Hamano <gitster@pobox.com>2016-04-15 10:12:19 -0700
commite6e7530d10b74d763b4311ea93e0a831b810d6c2 (patch)
tree7ac83d3fecd39d6076f24eaddd6719a24c3b6ce8 /test-fake-ssh.c
parent7897d84b8240720352e23030c35db461581b68e3 (diff)
downloadgit-e6e7530d10b74d763b4311ea93e0a831b810d6c2.tar.gz
test helpers: move test-* to t/helper/ subdirectory
This keeps top dir a bit less crowded. And because these programs are for testing purposes, it makes sense that they stay somewhere in t/ Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'test-fake-ssh.c')
-rw-r--r--test-fake-ssh.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/test-fake-ssh.c b/test-fake-ssh.c
deleted file mode 100644
index 980de216e1..0000000000
--- a/test-fake-ssh.c
+++ /dev/null
@@ -1,30 +0,0 @@
-#include "git-compat-util.h"
-#include "run-command.h"
-#include "strbuf.h"
-
-int main(int argc, char **argv)
-{
- const char *trash_directory = getenv("TRASH_DIRECTORY");
- struct strbuf buf = STRBUF_INIT;
- FILE *f;
- int i;
- const char *child_argv[] = { NULL, NULL };
-
- /* First, print all parameters into $TRASH_DIRECTORY/ssh-output */
- if (!trash_directory)
- die("Need a TRASH_DIRECTORY!");
- strbuf_addf(&buf, "%s/ssh-output", trash_directory);
- f = fopen(buf.buf, "w");
- if (!f)
- die("Could not write to %s", buf.buf);
- for (i = 0; i < argc; i++)
- fprintf(f, "%s%s", i > 0 ? " " : "", i > 0 ? argv[i] : "ssh:");
- fprintf(f, "\n");
- fclose(f);
-
- /* Now, evaluate the *last* parameter */
- if (argc < 2)
- return 0;
- child_argv[0] = argv[argc - 1];
- return run_command_v_opt(child_argv, RUN_USING_SHELL);
-}