about summary refs log tree commit diff
path: root/third_party/git/t/helper/test-windows-named-pipe.c
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-09-21T10·03+0300
committerVincent Ambo <mail@tazj.in>2021-09-21T11·29+0300
commit43b1791ec601732ac31195df96781a848360a9ac (patch)
treedaae8d638343295d2f1f7da955e556ef4c958864 /third_party/git/t/helper/test-windows-named-pipe.c
parent2d8e7dc9d9c38127ec4ebd13aee8e8f586a43318 (diff)
chore(3p/git): Unvendor git and track patches instead r/2903
This was vendored a long time ago under the expectation that keeping
it in sync with cgit would be easier this way, but it has proven not
to be a big issue.

On the other hand, a vendored copy of git is an annoying maintenance
burden. It is much easier to rebase the single (dottime) patch that we
have.

This removes the vendored copy of git and instead passes the git
source code to cgit via `pkgs.srcOnly`, which includes the applied
patch so that cgit can continue rendering dottime.

Change-Id: If31f62dea7ce688fd1b9050204e9378019775f2b
Diffstat (limited to 'third_party/git/t/helper/test-windows-named-pipe.c')
-rw-r--r--third_party/git/t/helper/test-windows-named-pipe.c72
1 files changed, 0 insertions, 72 deletions
diff --git a/third_party/git/t/helper/test-windows-named-pipe.c b/third_party/git/t/helper/test-windows-named-pipe.c
deleted file mode 100644
index ae52183e63..0000000000
--- a/third_party/git/t/helper/test-windows-named-pipe.c
+++ /dev/null
@@ -1,72 +0,0 @@
-#include "test-tool.h"
-#include "git-compat-util.h"
-#include "strbuf.h"
-
-#ifdef GIT_WINDOWS_NATIVE
-static const char *usage_string = "<pipe-filename>";
-
-#define TEST_BUFSIZE (4096)
-
-int cmd__windows_named_pipe(int argc, const char **argv)
-{
-	const char *filename;
-	struct strbuf pathname = STRBUF_INIT;
-	int err;
-	HANDLE h;
-	BOOL connected;
-	char buf[TEST_BUFSIZE + 1];
-
-	if (argc < 2)
-		goto print_usage;
-	filename = argv[1];
-	if (strpbrk(filename, "/\\"))
-		goto print_usage;
-	strbuf_addf(&pathname, "//./pipe/%s", filename);
-
-	/*
-	 * Create a single instance of the server side of the named pipe.
-	 * This will allow exactly one client instance to connect to it.
-	 */
-	h = CreateNamedPipeA(
-		pathname.buf,
-		PIPE_ACCESS_INBOUND | FILE_FLAG_FIRST_PIPE_INSTANCE,
-		PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT,
-		PIPE_UNLIMITED_INSTANCES,
-		TEST_BUFSIZE, TEST_BUFSIZE, 0, NULL);
-	if (h == INVALID_HANDLE_VALUE) {
-		err = err_win_to_posix(GetLastError());
-		fprintf(stderr, "CreateNamedPipe failed: %s\n",
-			strerror(err));
-		return err;
-	}
-
-	connected = ConnectNamedPipe(h, NULL)
-		? TRUE
-		: (GetLastError() == ERROR_PIPE_CONNECTED);
-	if (!connected) {
-		err = err_win_to_posix(GetLastError());
-		fprintf(stderr, "ConnectNamedPipe failed: %s\n",
-			strerror(err));
-		CloseHandle(h);
-		return err;
-	}
-
-	while (1) {
-		DWORD nbr;
-		BOOL success = ReadFile(h, buf, TEST_BUFSIZE, &nbr, NULL);
-		if (!success || nbr == 0)
-			break;
-		buf[nbr] = 0;
-
-		write(1, buf, nbr);
-	}
-
-	DisconnectNamedPipe(h);
-	CloseHandle(h);
-	return 0;
-
-print_usage:
-	fprintf(stderr, "usage: %s %s\n", argv[0], usage_string);
-	return 1;
-}
-#endif