about summary refs log tree commit diff
path: root/third_party/git/t/helper/test-progress.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-progress.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-progress.c')
-rw-r--r--third_party/git/t/helper/test-progress.c74
1 files changed, 0 insertions, 74 deletions
diff --git a/third_party/git/t/helper/test-progress.c b/third_party/git/t/helper/test-progress.c
deleted file mode 100644
index 5d05cbe78940..000000000000
--- a/third_party/git/t/helper/test-progress.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * A test helper to exercise the progress display.
- *
- * Reads instructions from standard input, one instruction per line:
- *
- *   "progress <items>" - Call display_progress() with the given item count
- *                        as parameter.
- *   "throughput <bytes> <millis> - Call display_throughput() with the given
- *                                  byte count as parameter.  The 'millis'
- *                                  specify the time elapsed since the
- *                                  start_progress() call.
- *   "update" - Set the 'progress_update' flag.
- *
- * See 't0500-progress-display.sh' for examples.
- */
-#define GIT_TEST_PROGRESS_ONLY
-#include "test-tool.h"
-#include "gettext.h"
-#include "parse-options.h"
-#include "progress.h"
-#include "strbuf.h"
-
-int cmd__progress(int argc, const char **argv)
-{
-	int total = 0;
-	const char *title;
-	struct strbuf line = STRBUF_INIT;
-	struct progress *progress;
-
-	const char *usage[] = {
-		"test-tool progress [--total=<n>] <progress-title>",
-		NULL
-	};
-	struct option options[] = {
-		OPT_INTEGER(0, "total", &total, "total number of items"),
-		OPT_END(),
-	};
-
-	argc = parse_options(argc, argv, NULL, options, usage, 0);
-	if (argc != 1)
-		die("need a title for the progress output");
-	title = argv[0];
-
-	progress_testing = 1;
-	progress = start_progress(title, total);
-	while (strbuf_getline(&line, stdin) != EOF) {
-		char *end;
-
-		if (skip_prefix(line.buf, "progress ", (const char **) &end)) {
-			uint64_t item_count = strtoull(end, &end, 10);
-			if (*end != '\0')
-				die("invalid input: '%s'\n", line.buf);
-			display_progress(progress, item_count);
-		} else if (skip_prefix(line.buf, "throughput ",
-				       (const char **) &end)) {
-			uint64_t byte_count, test_ms;
-
-			byte_count = strtoull(end, &end, 10);
-			if (*end != ' ')
-				die("invalid input: '%s'\n", line.buf);
-			test_ms = strtoull(end + 1, &end, 10);
-			if (*end != '\0')
-				die("invalid input: '%s'\n", line.buf);
-			progress_test_ns = test_ms * 1000 * 1000;
-			display_throughput(progress, byte_count);
-		} else if (!strcmp(line.buf, "update"))
-			progress_test_force_update();
-		else
-			die("invalid input: '%s'\n", line.buf);
-	}
-	stop_progress(&progress);
-
-	return 0;
-}