Commit 23b19d00d9aa2815c3e8eaa76bf67cf5b54fe4e5

Stefan Sperling 2018-03-12T14:08:37

fix worktree test build: remove more unused variables

diff --git a/lib/fileindex.c b/lib/fileindex.c
index 8ca7884..349b0aa 100644
--- a/lib/fileindex.c
+++ b/lib/fileindex.c
@@ -184,7 +184,7 @@ write_fileindex_entry(SHA1_CTX *ctx, struct got_fileindex_entry *entry,
     FILE *outfile)
 {
 	const struct got_error *err;
-	size_t n, len, pad;
+	size_t n;
 
 	err = write_fileindex_val64(ctx, entry->ctime_sec, outfile);
 	if (err)
diff --git a/lib/worktree.c b/lib/worktree.c
index 78b75a9..1273d61 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -235,7 +235,6 @@ got_worktree_open(struct got_worktree **worktree, const char *path)
 {
 	const struct got_error *err = NULL;
 	char *path_got;
-	char *refstr = NULL;
 	char *formatstr = NULL;
 	char *path_lock = NULL;
 	int version, fd = -1;
@@ -432,7 +431,6 @@ add_dir_on_disk(struct got_worktree *worktree, const char *path)
 {
 	const struct got_error *err = NULL;
 	char *abspath;
-	size_t len;
 
 	if (asprintf(&abspath, "%s/%s", worktree->root_path,
 	    apply_path_prefix(worktree, path)) == -1)
diff --git a/regress/worktree/worktree_test.c b/regress/worktree/worktree_test.c
index 1141928..84ee710 100644
--- a/regress/worktree/worktree_test.c
+++ b/regress/worktree/worktree_test.c
@@ -104,7 +104,6 @@ static int
 read_meta_file(char **content, const char *path)
 {
 	FILE *f;
-	size_t n;
 	size_t len;
 	const char delim[3] = {'\0', '\0', '\0'};
 	int ret = 0;
@@ -249,9 +248,7 @@ worktree_init_exists(const char *repo_path)
 	struct got_repository *repo = NULL;
 	char worktree_path[PATH_MAX];
 	char *gotpath = NULL;
-	char *path;
 	int ok = 0;
-	FILE *f;
 
 	err = got_repo_open(&repo, repo_path);
 	if (err != NULL || repo == NULL)
@@ -383,7 +380,6 @@ main(int argc, char *argv[])
 	int test_ok = 0, failure = 0;
 	const char *repo_path;
 	int ch;
-	int vflag = 0;
 
 	while ((ch = getopt(argc, argv, "v")) != -1) {
 		switch (ch) {