commit b6b86fd1b9828e38d59915e62fddce62952b8b75 from: Josiah Frentsos via: Thomas Adam date: Tue Aug 30 18:37:47 2022 UTC remove trailing whitespace; patch by Josiah Frentsos commit - 3f0158b49db4d4cb897b892d200ffe07edb29e8e commit + b6b86fd1b9828e38d59915e62fddce62952b8b75 blob - f69d6c8dd736869bae7431e0cf4350b2a1b8e1ef blob + cd476af86afe21052079d72b05d9cbf27c899f28 --- LICENCE +++ LICENCE @@ -1,10 +1,10 @@ Copyright (c) 2017, 2018, 2019, 2020, 2021, 2022 Stefan Sperling - + Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR blob - 65a62a169432829c5bf7f9231226468273be39ad blob + bdf06b70325f2720ec4a7f3bcdc35c740b1052f2 --- got/got.1 +++ got/got.1 @@ -1065,7 +1065,7 @@ work tree, use the repository path associated with thi .It Xo .Cm ref .Op Fl dlt -.Op Fl c Ar object +.Op Fl c Ar object .Op Fl r Ar repository-path .Op Fl s Ar reference .Op Ar name blob - 211813953bcd89f62340834b3a8397639208843d blob + 150fdbe702f1959dfe51bf03f8550c054ee87e2a --- got/got.c +++ got/got.c @@ -1323,8 +1323,8 @@ create_gotconfig(const char *proto, const char *host, GOT_FETCH_DEFAULT_REMOTE_NAME, host, proto, port ? "\tport " : "", port ? port : "", port ? "\n" : "", remote_repo_path, branches ? "\tbranch { " : "", - branches ? branches : "", branches ? "}\n" : "", - refs ? "\treference { " : "", refs ? refs : "", refs ? "}\n" : "", + branches ? branches : "", branches ? "}\n" : "", + refs ? "\treference { " : "", refs ? refs : "", refs ? "}\n" : "", mirror_references ? "\tmirror_references yes\n" : "", fetch_all_branches ? "\tfetch_all_branches yes\n" : "") == -1) { err = got_error_from_errno("asprintf"); @@ -2125,7 +2125,7 @@ delete_missing_refs(struct got_pathlist_head *their_re their_refname = local_refname; } - + TAILQ_FOREACH(pe, their_refs, entry) { if (strcmp(their_refname, pe->path) == 0) break; @@ -2597,7 +2597,7 @@ cmd_fetch(int argc, char *argv[]) if (error) { if (error->code != GOT_ERR_NOT_REF) goto done; - error = create_ref(remote_refname, id, + error = create_ref(remote_refname, id, verbosity, repo); if (error) goto done; @@ -4126,7 +4126,7 @@ print_commit(struct got_commit_object *commit, struct printf(GOT_COMMIT_SEP_STR); if (custom_refs_str) - printf("commit %s (%s)\n", id_str, custom_refs_str); + printf("commit %s (%s)\n", id_str, custom_refs_str); else printf("commit %s%s%s%s\n", id_str, refs_str ? " (" : "", refs_str ? refs_str : "", refs_str ? ")" : ""); @@ -8403,7 +8403,6 @@ done: *logmsg = NULL; } return err; - } static const struct got_error * blob - 009854ae5d5b1ffd5bcae68ed4a45f02f9ebd094 blob + bbf89ab6811444ff2a1c0aa31074d2c78b7f4382 --- gotadmin/gotadmin.c +++ gotadmin/gotadmin.c @@ -980,7 +980,7 @@ list_pack_cb(void *arg, struct got_object_id *id, int break; case GOT_OBJ_TYPE_REF_DELTA: type_str = "ref-delta"; - err = got_object_id_str(&base_id_str, base_id); + err = got_object_id_str(&base_id_str, base_id); if (err) goto done; if (asprintf(&delta_str, " base-id %s", base_id_str) == -1) { blob - 9d0bbf58f683adb056c946f2084ab2897e4509f3 blob + c6db1d281f02e6030400a87b216c3aec949a37f9 --- gotweb/gotweb.c +++ gotweb/gotweb.c @@ -268,7 +268,7 @@ static const struct gw_query_action gw_query_funcs[] = { GW_TREE, "tree", gw_tree, "gw_tmpl/tree.tmpl" }, }; -static const char * +static const char * gw_get_action_name(struct gw_trans *gw_trans) { return gw_query_funcs[gw_trans->action].func_name; @@ -4503,7 +4503,7 @@ gw_output_repo_tree(struct gw_trans *gw_trans, struct href_blame = khttp_urlpart(NULL, NULL, "gotweb", "path", gw_trans->repo_name, "action", "blame", "commit", gw_trans->commit_id, "file", - got_tree_entry_get_name(te), "folder", + got_tree_entry_get_name(te), "folder", gw_trans->repo_folder ? gw_trans->repo_folder : "", NULL); if (href_blame == NULL) { blob - 0ec6a27f7f19f04fc2dcb6a9c0eb2a7ba9d73f81 blob + 22972bfde8dd77604f386036ac3fa6a4d05846d4 --- gotwebd/proc.c +++ gotwebd/proc.c @@ -216,7 +216,7 @@ proc_init(struct privsep *ps, struct privsep_proc *pro proc_setup(ps, procs, nproc); /* - * Create the children sockets so we can use them + * Create the children sockets so we can use them * to distribute the rest of the socketpair()s using * proc_connect() later. */ blob - 1cd6f349912d3e03ebbdccfd4beeeb54663af7fb blob + 4e49d36a9dfb5392b25c430b1fa90b30c898c3ed --- include/got_object.h +++ include/got_object.h @@ -240,7 +240,7 @@ int got_object_tree_entry_is_symlink(struct got_tree_e * corresponding to the specified commit. If the specified path is not * a symlink then set *link_target to NULL. * Otherwise, resolve symlinks recursively and return the final link - * target path. The caller must dispose of it with free(3). + * target path. The caller must dispose of it with free(3). */ const struct got_error *got_object_resolve_symlinks(char **, const char *, struct got_commit_object *, struct got_repository *); blob - 98714899272ce0d54688d9e1a90e5ac5f0e93087 blob + b3626e6cc55a8ad4c5d1b2e62293dafc283a1c05 --- include/got_reference.h +++ include/got_reference.h @@ -185,7 +185,7 @@ struct got_reflist_object_id_map; * The caller must dispose of the map with got_reflist_object_id_map_free(). */ const struct got_error *got_reflist_object_id_map_create( - struct got_reflist_object_id_map **, struct got_reflist_head *, + struct got_reflist_object_id_map **, struct got_reflist_head *, struct got_repository *); /* blob - b2b02753e786580598a72d4ccfa4aeb006309afe blob + e4bb25a6d8b1e1b7189a15dca86d54453d48cf39 --- include/got_worktree.h +++ include/got_worktree.h @@ -530,7 +530,7 @@ typedef const struct got_error *(*got_worktree_path_in struct got_object_id *blob_id, struct got_object_id *staged_blob_id, struct got_object_id *commit_id); -/* +/* * Report work-tree meta data for paths in the work tree. * The info callback will be invoked with the provided void * argument, * a path, and meta-data arguments (see got_worktree_path_info_cb). blob - 9ad6d532d61bbc59e1272cc8ffae2bb8bbdede9b blob + 5a86e1b7b7cbe92252f4617311f6639b8edb06c5 --- lib/blame.c +++ lib/blame.c @@ -62,7 +62,7 @@ struct got_blame { * These change with every traversed commit. After diffing * commits N:N-1, in preparation for diffing commits N-1:N-2, * data for commit N is retained and flipped into data for N-1. - * + * */ FILE *f1; /* older version from commit N-1. */ FILE *f2; /* newer version from commit N. */ @@ -473,7 +473,7 @@ flip_files(struct got_blame *blame) err = got_opentemp_truncate(blame->f2); if (err) - return err; + return err; tmp = blame->f2; blame->f2 = blame->f1; blame->f1 = tmp; blob - ee175dcf640d5b8d7770236de9c443a5888891dd blob + ec7805123586f40fc51bef645d1f9db8e381f579 --- lib/diffreg.c +++ lib/diffreg.c @@ -247,7 +247,7 @@ done: *diffreg_result = NULL; } } - + return err; } blob - 471ae3a865feeef0f562632eb264f4e49cce2dae blob + 933f60daff9dfba84b076bb4d53e03af1d48831b --- lib/fetch.c +++ lib/fetch.c @@ -417,7 +417,7 @@ got_fetch_pack(struct got_object_id **pack_hash, struc err = got_error_from_errno("lseek"); goto done; } - + if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, imsg_idxfds) == -1) { err = got_error_from_errno("socketpair"); goto done; blob - 3e29956ae33fe8c3411cc0f607d762679e49d571 blob + 483771419c2b844e139052425b5c7089f73bb68a --- lib/fileindex.c +++ lib/fileindex.c @@ -1203,7 +1203,7 @@ got_fileindex_diff_dir(struct got_fileindex *fileindex TAILQ_INIT(&dirlist); - /* + /* * Duplicate the file descriptor so we can call closedir() below * without closing the file descriptor passed in by our caller. */ blob - 43c7096d0a3fe2bb611660d822341235f3223a17 blob + 740595aedb09404e54af0b7760c3df40c71930c1 --- lib/got_lib_diff.h +++ lib/got_lib_diff.h @@ -41,7 +41,7 @@ struct got_diffreg_result { const struct got_error *got_diff_get_config(struct diff_config **, enum got_diff_algorithm, diff_atomize_func_t, void *); const struct got_error *got_diff_prepare_file(FILE *, char **, size_t *, - struct diff_data *, const struct diff_config *, int, int); + struct diff_data *, const struct diff_config *, int, int); const struct got_error *got_diffreg(struct got_diffreg_result **, FILE *, FILE *, enum got_diff_algorithm, int, int); const struct got_error *got_diffreg_output(struct got_diff_line **, size_t *, blob - 977f28bca21557ad62008b7a21e4d731ecc5cbd9 blob + decb643f317e45f572f429fd41d02f2c578772b0 --- lib/got_lib_lockfile.h +++ lib/got_lib_lockfile.h @@ -16,7 +16,7 @@ /* * Git-compatible lock file implementation. Lock files are used to - * ensure exclusive access when files in a GIt repository are modified. + * ensure exclusive access when files in a Git repository are modified. */ #define GOT_LOCKFILE_SUFFIX ".lock" blob - 24c7c68b7574559306b53c587c4f7d5e5374d02d blob + c6df6ebc501bda287c7350222f5e4ccf706763bf --- lib/got_lib_pack.h +++ lib/got_lib_pack.h @@ -73,7 +73,7 @@ struct got_packidx_v2_hdr { #define GOT_PACKIDX_V2_MAGIC 0xff744f63 /* "\377t0c" */ uint32_t *version; - /* + /* * Each entry N in the fanout table contains the number of objects in * the packfile whose SHA1 begins with a byte less than or equal to N. * The last entry (index 255) contains the number of objects in the @@ -132,7 +132,7 @@ struct got_packfile_hdr { }; struct got_packfile_obj_hdr { - /* + /* * The object size field uses a variable length encoding: * size0...sizeN form a 4+7+7+...+7 bit integer, where size0 is the * least significant part and sizeN is the most significant part. @@ -161,7 +161,7 @@ struct got_packfile_object_data_ref_delta { /* If object is of type GOT_OBJ_TYPE_OFFSET_DELTA. */ struct got_packfile_object_data_offset_delta { - /* + /* * This offset is interpreted as a negative offset from * the got_packfile_obj_hdr corresponding to this object. * The size provided in the header specifies the amount blob - 4fe2f0ffd0ca86387452b6b7ff95282358bcd66d blob + 28231bbf9bfed76cccd642d016636c357a469dee --- lib/got_lib_privsep.h +++ lib/got_lib_privsep.h @@ -815,7 +815,7 @@ const struct got_error *got_privsep_send_delta_reuse_r const struct got_error *got_privsep_send_reused_deltas(struct imsgbuf *, struct got_imsg_reused_delta *, size_t); const struct got_error *got_privsep_send_reused_deltas_done(struct imsgbuf *); -const struct got_error *got_privsep_recv_reused_deltas(int *, +const struct got_error *got_privsep_recv_reused_deltas(int *, struct got_imsg_reused_delta *, size_t *, struct imsgbuf *); const struct got_error *got_privsep_init_commit_painting(struct imsgbuf *); blob - 401bb162fea4063ab606d8427b8d6908aa94ce93 blob + 21fad5b154a20fc855d0ce6c797036d023e0bc9d --- lib/inflate.c +++ lib/inflate.c @@ -346,7 +346,7 @@ done: const struct got_error * got_inflate_to_mem_fd(uint8_t **outbuf, size_t *outlen, - size_t *consumed_total, struct got_inflate_checksum *csum, + size_t *consumed_total, struct got_inflate_checksum *csum, size_t expected_size, int infd) { const struct got_error *err; blob - 2a520b7792465ad27ff73f8f2cf3b88ec2274d9f blob + 94d5fe5a3a025d6c2cb87ea46f604bcaebff5473 --- lib/object.c +++ lib/object.c @@ -176,7 +176,7 @@ pack_child_send_tempfiles(struct imsgbuf *ibuf, struct const struct got_error *err; int basefd = -1, accumfd = -1; - /* + /* * For performance reasons, the child will keep reusing the * same temporary files during every object request. * Opening and closing new files for every object request is @@ -887,7 +887,7 @@ got_object_id_queue_copy(const struct got_object_id_qu * Deep-copy the object ID only. Let the caller deal * with setting up the new->data pointer if needed. */ - err = got_object_qid_alloc(&new, &qid->id); + err = got_object_qid_alloc(&new, &qid->id); if (err) { got_object_id_queue_free(dest); return err; blob - a99a2cd31590e898057c912de186ce8b4015810a blob + dc9175ad60883e788dd8423ab2847d17d17539ce --- lib/object_idset.c +++ lib/object_idset.c @@ -165,7 +165,7 @@ got_object_idset_add(struct got_object_idset *set, str if (set->totelem == UINT_MAX) return got_error(GOT_ERR_NO_SPACE); - + err = got_object_qid_alloc_partial(&qid); if (err) return err; blob - 8d08d6deffb8178a2c7cdf10be2b31a05a990a49 blob + 9856ed49e2b883f98a02bbebcbe3f1db8214d298 --- lib/object_parse.c +++ lib/object_parse.c @@ -357,7 +357,7 @@ parse_commit_time(time_t *time, time_t *gmtoff, char * return got_error_from_errno("strdup"); err = parse_gmtoff(gmtoff, tzstr); free(tzstr); - if (err) { + if (err) { if (err->code != GOT_ERR_BAD_OBJ_DATA) return err; /* Old versions of Git omitted the timestamp. */ blob - b9d01bc54875ebb843836ca6334c22560fb48ceb blob + eebd3b2afaf7965abda7f13aa0535b7ddbba9dac --- lib/pack_create.c +++ lib/pack_create.c @@ -497,7 +497,7 @@ add_meta(struct got_pack_meta *m, struct got_pack_meta if (new == NULL) return got_error_from_errno("reallocarray"); v->meta = new; - v->metasz = newsize; + v->metasz = newsize; } v->meta[v->nmeta++] = m; @@ -1740,7 +1740,7 @@ findtwixt(struct got_object_id ***res, int *nres, int err = queue_commit_or_tag_id(id, COLOR_KEEP, &ids, repo); if (err) goto done; - } + } for (i = 0; i < ntail; i++) { struct got_object_id *id = tail[i]; blob - 8b6a7883c5322c4c6dd57139795e92de0f5388b6 blob + c4d6fa4ea1ac77327a9737ec50199120184515eb --- lib/repository.c +++ lib/repository.c @@ -1162,7 +1162,7 @@ add_packidx_bloom_filter(struct got_repository *repo, free(bf); return got_error_from_errno("calloc"); } - + len = strlcpy(bf->path, path_packidx, sizeof(bf->path)); if (len >= sizeof(bf->path)) { free(bf->bloom); @@ -1432,7 +1432,7 @@ got_repo_cache_pack(struct got_pack **packp, struct go return got_error_from_errno("ftruncate"); if (ftruncate(repo->packs[i].accumfd, 0L) == -1) return got_error_from_errno("ftruncate"); - memcpy(&tmp, &repo->packs[i], sizeof(tmp)); + memcpy(&tmp, &repo->packs[i], sizeof(tmp)); memcpy(&repo->packs[i], &repo->packs[0], sizeof(repo->packs[i])); memcpy(&repo->packs[0], &tmp, sizeof(repo->packs[0])); @@ -2063,7 +2063,7 @@ import_subdir(struct got_tree_entry **new_te, struct d if (err) goto done; memcpy(&(*new_te)->id, id, sizeof((*new_te)->id)); - + done: free(id); free(subdirpath); blob - ce4d2e366de4474e9139d30553568c1a9d1558a3 blob + c9240e01f5801a2f638e3122e88e4b68edb6ad55 --- lib/repository_admin.c +++ lib/repository_admin.c @@ -827,7 +827,6 @@ load_tree_entries(struct got_object_id_queue *ids, err = got_object_idset_add(traversed_ids, id, NULL); if (err) break; - } free(p); p = NULL; @@ -1010,7 +1009,7 @@ load_commit_or_tag(struct got_object_idset *loose_ids, nloose, *ncommits, -1); if (err) break; - + if (commit) { /* Find parent commits to scan. */ const struct got_object_id_queue *parent_ids; blob - c35eff9d90a4e362a03f90e425f1bcb1c0917632 blob + 4c2a71542b7b46f96a3aa97b095afdcdb61be55f --- lib/worktree.c +++ lib/worktree.c @@ -1032,7 +1032,7 @@ merge_blob(int *local_changes_subsumed, struct got_wor goto done; } - /* + /* * In order the run a 3-way merge with a symlink we copy the symlink's * target path into a temporary file and use that file with diff3. */ @@ -3552,7 +3552,7 @@ add_ignores(struct got_pathlist_head *ignores, const c ignorespath); } else { ignoresfile = fdopen(fd, "r"); - if (ignoresfile == NULL) + if (ignoresfile == NULL) err = got_error_from_errno2("fdopen", ignorespath); else { @@ -4096,7 +4096,7 @@ schedule_for_deletion(void *arg, unsigned char status, if (status == a->status_codes[i]) break; } - if (i == ncodes) { + if (i == ncodes) { /* Do not delete files in non-matching status. */ free(ondisk_path); return NULL; @@ -4353,7 +4353,7 @@ apply_or_reject_change(int *choice, int *nchunks_used, got_worktree_patch_cb patch_cb, void *patch_arg) { const struct got_error *err = NULL; - struct diff_chunk_context cc = {}; + struct diff_chunk_context cc = {}; int start_old, end_old, start_new, end_new; FILE *hunkfile; struct diff_output_unidiff_state *diff_state; @@ -4560,7 +4560,7 @@ create_patched_content(char **path_outfile, int revers /* Count the number of actual changes in the diff result. */ for (n = 0; n < diffreg_result->result->chunks.len; n += nchunks_used) { - struct diff_chunk_context cc = {}; + struct diff_chunk_context cc = {}; diff_chunk_context_load_change(&cc, &nchunks_used, diffreg_result->result, n, 0); nchanges++; @@ -8542,7 +8542,7 @@ unstage_hunks(struct got_object_id *staged_blob_id, if (err) goto done; - /* + /* * In order the run a 3-way merge with a symlink we copy the symlink's * target path into a temporary file and use that file with diff3. */ blob - 14ac29c54a6da23eba622b0d224010a5752bc387 blob + 58bc7d00a21178c003a4b9107128d91885e349f1 --- libexec/got-fetch-pack/got-fetch-pack.c +++ libexec/got-fetch-pack/got-fetch-pack.c @@ -77,7 +77,7 @@ match_remote_ref(struct got_pathlist_head *have_refs, TAILQ_FOREACH(pe, have_refs, entry) { struct got_object_id *id = pe->data; - if (strcmp(pe->path, refname) == 0) { + if (strcmp(pe->path, refname) == 0) { memcpy(my_id, id, sizeof(*my_id)); break; } blob - c400c28786bbce149b2ff26efb3230c03908d0f0 blob + 15919e737df2245aa19b9e22ef60d2e83b822740 --- libexec/got-index-pack/got-index-pack.c +++ libexec/got-index-pack/got-index-pack.c @@ -74,10 +74,10 @@ struct got_indexed_object { uint64_t size; /* Length of on-disk type+size data. */ - size_t tslen; + size_t tslen; /* Length of object data following type+size. */ - size_t len; + size_t len; uint32_t crc; @@ -498,7 +498,7 @@ print_packidx(struct got_packidx *packidx) uint32_t offset = be32toh(packidx->hdr.offsets[i]); if (offset & GOT_PACKIDX_OFFSET_VAL_IS_LARGE_IDX) { int j = offset & GOT_PACKIDX_OFFSET_VAL_MASK; - fprintf(stderr, "%u -> %llu\n", offset, + fprintf(stderr, "%u -> %llu\n", offset, be64toh(packidx->hdr.large_offsets[j])); } else fprintf(stderr, "%u\n", offset); blob - a7926468d37341ec3abda1461278f7fbf74f205e blob + eff5ccf4f78170ab2a5144c001c046c3ad1fbd2e --- libexec/got-read-pack/got-read-pack.c +++ libexec/got-read-pack/got-read-pack.c @@ -851,7 +851,7 @@ get_base_object_id(struct got_object_id *base_id, stru const struct got_error *err; int idx; - err = got_packidx_get_offset_idx(&idx, packidx, base_offset); + err = got_packidx_get_offset_idx(&idx, packidx, base_offset); if (err) return err; if (idx == -1) @@ -1727,7 +1727,7 @@ commit_painting_free(struct got_object_idset **keep, *drop = NULL; } if (*skip) { - got_object_idset_free(*skip); + got_object_idset_free(*skip); *skip = NULL; } } blob - c71c6afab33ae912f95e2c86e055ad3a30bb8abf blob + eeaed35bb53acf35da12bb566d97aab85fd3761a --- libexec/got-send-pack/got-send-pack.c +++ libexec/got-send-pack/got-send-pack.c @@ -117,7 +117,7 @@ recv_packfd(int *packfd, struct imsgbuf *ibuf) err = got_privsep_recv_imsg(&imsg, ibuf, 0); if (err) return err; - + if (imsg.hdr.type == GOT_IMSG_STOP) { err = got_error(GOT_ERR_CANCELLED); goto done; blob - cef3e140e272e2170ff54b98a60b04316659093d blob + f7e5a31ee56ac3317eb9169b6df6ccb743c92591 --- regress/cmdline/blame.sh +++ regress/cmdline/blame.sh @@ -579,7 +579,7 @@ blob + c787aadf05e2afab61bd34976f7349912252e6da @@ -14,5 +14,22 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - + +/* + * Write an annotated version of a file at a given in-repository path, + * as found in the commit specified by ID, to the specified output file. @@ -658,7 +658,7 @@ blob + 6075cadbd177e1802679c7353515bf4ceebb51d0 +++ got_blame.h @@ -15,14 +15,7 @@ */ - + /* - * Write an annotated version of a file at a given in-repository path, - * as found in the commit specified by ID, to the specified output file. blob - f73f4a345848c012f6f17f10fba4accf493f8ae0 blob + 60e1f0fac6ad4a1710f1b237ccc1120775fab326 --- regress/cmdline/cat.sh +++ regress/cmdline/cat.sh @@ -70,7 +70,6 @@ test_cat_basic() { # TODO: test cat tag test_done "$testroot" "$ret" - } test_cat_path() { blob - 5cd3fe5876e2470973ab90d512629ae0a5331d16 blob + 1b6225239a7ffad05a3a5d7307cdf6927fb2cc5c --- regress/cmdline/cherrypick.sh +++ regress/cmdline/cherrypick.sh @@ -270,7 +270,7 @@ test_cherrypick_into_work_tree_with_mixed_commits() { local first_rev=`git_show_head $testroot/repo` echo "modified alpha" > $testroot/repo/alpha - git_commit $testroot/repo -m "committing to alpha" + git_commit $testroot/repo -m "committing to alpha" local second_rev=`git_show_head $testroot/repo` got checkout $testroot/repo $testroot/wt > /dev/null @@ -1308,7 +1308,6 @@ got_ref_list_free(struct got_reflist_head *refs) TAILQ_REMOVE(refs, re, entry); free(re); } - } EOF (cd $testroot/repo && git add reference.c) @@ -1369,7 +1368,7 @@ EOF + got_ref_close(re->ref); free(re); } - + } EOF (cd $testroot/wt && got diff | egrep -v '^(diff|blob|file|commit|path)' > $testroot/diff) blob - 3954e49687822fe5189c01448be0183865291c02 blob + 57b5461e1fbccf0b140efa562c91834f7f3db187 --- regress/cmdline/log.sh +++ regress/cmdline/log.sh @@ -503,7 +503,7 @@ test_log_end_at_commit() { # got will refuse -x with a non-existent commit (cd $testroot/wt && got log -x nonexistent \ - > $testroot/stdout 2> $testroot/stderr) + > $testroot/stdout 2> $testroot/stderr) ret=$? if [ $ret -eq 0 ]; then echo "log command succeeded unexpectedly" >&2 @@ -530,9 +530,9 @@ test_log_end_at_commit() { # try the same with the hash of an empty string which is very # unlikely to match any object - local empty_sha1=da39a3ee5e6b4b0d3255bfef95601890afd80709 + local empty_sha1=da39a3ee5e6b4b0d3255bfef95601890afd80709 (cd $testroot/wt && got log -x $empty_sha1 \ - > $testroot/stdout 2> $testroot/stderr) + > $testroot/stdout 2> $testroot/stderr) ret=$? if [ $ret -eq 0 ]; then echo "log command succeeded unexpectedly" >&2 blob - 0d03d0c83a725429e9a8d665b4e26dcbfe287e8c blob + 3f0578e460b5ab26c3e92ecb652e7a6e21f4cb65 --- regress/cmdline/merge.sh +++ regress/cmdline/merge.sh @@ -52,7 +52,7 @@ test_merge_basic() { return 1 fi - # need a divergant commit on the main branch for 'got merge' + # need a divergant commit on the main branch for 'got merge' (cd $testroot/wt && got merge newbranch \ > $testroot/stdout 2> $testroot/stderr) ret=$? @@ -82,7 +82,7 @@ test_merge_basic() { git_commit $testroot/repo -m "committing to zeta on master" local master_commit=`git_show_head $testroot/repo` - # need an up-to-date work tree for 'got merge' + # need an up-to-date work tree for 'got merge' (cd $testroot/wt && got merge newbranch \ > $testroot/stdout 2> $testroot/stderr) ret=$? @@ -110,7 +110,7 @@ test_merge_basic() { return 1 fi - # must not use a mixed-commit work tree with 'got merge' + # must not use a mixed-commit work tree with 'got merge' (cd $testroot/wt && got update -c $commit0 alpha > /dev/null) ret=$? if [ $ret -ne 0 ]; then @@ -146,7 +146,7 @@ test_merge_basic() { return 1 fi - # must not have staged files with 'got merge' + # must not have staged files with 'got merge' echo "modified file alpha" > $testroot/wt/alpha (cd $testroot/wt && got stage alpha > /dev/null) ret=$? @@ -179,7 +179,7 @@ test_merge_basic() { return 1 fi - # must not have local changes with 'got merge' + # must not have local changes with 'got merge' (cd $testroot/wt && got merge newbranch \ > $testroot/stdout 2> $testroot/stderr) ret=$? @@ -406,7 +406,7 @@ test_merge_continue() { git_commit $testroot/repo -m "committing to alpha on master" local master_commit=`git_show_head $testroot/repo` - # need an up-to-date work tree for 'got merge' + # need an up-to-date work tree for 'got merge' (cd $testroot/wt && got update > /dev/null) ret=$? if [ $ret -ne 0 ]; then @@ -631,7 +631,7 @@ test_merge_abort() { git_commit $testroot/repo -m "committing to alpha on master" local master_commit=`git_show_head $testroot/repo` - # need an up-to-date work tree for 'got merge' + # need an up-to-date work tree for 'got merge' (cd $testroot/wt && got update > /dev/null) ret=$? if [ $ret -ne 0 ]; then @@ -812,7 +812,7 @@ test_merge_in_progress() { git_commit $testroot/repo -m "committing to alpha on master" local master_commit=`git_show_head $testroot/repo` - # need an up-to-date work tree for 'got merge' + # need an up-to-date work tree for 'got merge' (cd $testroot/wt && got update > /dev/null) ret=$? if [ $ret -ne 0 ]; then @@ -916,7 +916,7 @@ test_merge_path_prefix() { git_commit $testroot/repo -m "committing to alpha on master" local master_commit=`git_show_head $testroot/repo` - # need an up-to-date work tree for 'got merge' + # need an up-to-date work tree for 'got merge' (cd $testroot/wt && got update > /dev/null) ret=$? if [ $ret -ne 0 ]; then @@ -970,7 +970,7 @@ test_merge_missing_file() { git_commit $testroot/repo -m "moving alpha on master" local master_commit=`git_show_head $testroot/repo` - # need an up-to-date work tree for 'got merge' + # need an up-to-date work tree for 'got merge' (cd $testroot/wt && got update > /dev/null) ret=$? if [ $ret -ne 0 ]; then @@ -1053,7 +1053,7 @@ test_merge_no_op() { git_commit $testroot/repo -m "committing to alpha on master" local master_commit=`git_show_head $testroot/repo` - # need an up-to-date work tree for 'got merge' + # need an up-to-date work tree for 'got merge' (cd $testroot/wt && got update > /dev/null) ret=$? if [ $ret -ne 0 ]; then @@ -1271,7 +1271,7 @@ test_merge_interrupt() { git_commit $testroot/repo -m "committing to beta on master" local master_commit=`git_show_head $testroot/repo` - # need an up-to-date work tree for 'got merge' + # need an up-to-date work tree for 'got merge' (cd $testroot/wt && got update > /dev/null) ret=$? if [ $ret -ne 0 ]; then blob - ead30c929edf2310158a6582d4f9f9410bbdb820 blob + df770659022e0e33a3f45f53f5824326227836c9 --- regress/cmdline/rebase.sh +++ regress/cmdline/rebase.sh @@ -974,7 +974,7 @@ test_rebase_forward() { > /dev/null) local commit2=`git_show_head $testroot/repo` - # Simulate a situation where fast-forward is required. + # Simulate a situation where fast-forward is required. # We want to fast-forward master to origin/master: # commit 3907e11dceaae2ca7f8db79c2af31794673945ad (origin/master) # commit ffcffcd102cf1af6572fbdbb4cf07a0f1fd2d840 (master) blob - 563ef75073b34c24187086af0ec4227156583358 blob + b86a51bf2a102808072428b8f575dc6a449b6769 --- regress/cmdline/ref.sh +++ regress/cmdline/ref.sh @@ -433,7 +433,7 @@ test_ref_list() { test_done "$testroot" "$ret" return 1 fi - done + done test_done "$testroot" "$ret" } blob - 9b68f290f9a1292250e21ea6a0e37961d6e9179c blob + f989b0dbd6a3ca710184d881f574e55a5eb83e78 --- regress/cmdline/send.sh +++ regress/cmdline/send.sh @@ -54,7 +54,7 @@ EOF test_done "$testroot" "$ret" return 1 fi - + echo -n > $testroot/stdout.expected cmp -s $testroot/stdout $testroot/stdout.expected ret=$? @@ -128,7 +128,7 @@ EOF test_done "$testroot" "$ret" return 1 fi - + echo 'Connecting to "origin" 127.0.0.1' > $testroot/stdout.expected echo "Already up-to-date" >> $testroot/stdout.expected cmp -s $testroot/stdout $testroot/stdout.expected @@ -178,7 +178,7 @@ EOF test_done "$testroot" 1 return 1 fi - + echo -n > $testroot/stdout.expected cmp -s $testroot/stdout $testroot/stdout.expected ret=$? @@ -258,7 +258,7 @@ EOF test_done "$testroot" "$ret" return 1 fi - + echo -n > $testroot/stdout.expected cmp -s $testroot/stdout $testroot/stdout.expected ret=$? @@ -530,7 +530,7 @@ test_send_clone_and_send() { test_done "$testroot" "$ret" return 1 fi - + echo -n > $testroot/stdout.expected cmp -s $testroot/stdout $testroot/stdout.expected ret=$? @@ -629,7 +629,7 @@ EOF test_done "$testroot" "$ret" return 1 fi - + echo -n > $testroot/stdout.expected cmp -s $testroot/stdout $testroot/stdout.expected ret=$? @@ -706,7 +706,7 @@ EOF test_done "$testroot" "$ret" return 1 fi - + echo -n > $testroot/stdout.expected cmp -s $testroot/stdout $testroot/stdout.expected ret=$? @@ -771,7 +771,7 @@ EOF test_done "$testroot" "$ret" return 1 fi - + # overwrite the 1.0 tag only got send -q -r $testroot/repo -t 1.0 -f > $testroot/stdout \ 2> $testroot/stderr @@ -781,7 +781,7 @@ EOF test_done "$testroot" "$ret" return 1 fi - + got tag -l -r $testroot/repo-clone | grep ^tag | sort > $testroot/stdout echo "tag 1.0 $tag_id3" > $testroot/stdout.expected echo "tag 2.0 $tag_id2" >> $testroot/stdout.expected @@ -890,7 +890,7 @@ EOF test_done "$testroot" "$ret" return 1 fi - + echo -n > $testroot/stdout.expected cmp -s $testroot/stdout $testroot/stdout.expected ret=$? @@ -994,7 +994,7 @@ test_send_new_branch() { test_done "$testroot" "$ret" return 1 fi - + echo -n > $testroot/stdout.expected cmp -s $testroot/stdout $testroot/stdout.expected ret=$? @@ -1230,7 +1230,7 @@ EOF test_done "$testroot" "$ret" return 1 fi - + echo -n > $testroot/stdout.expected cmp -s $testroot/stdout $testroot/stdout.expected ret=$? @@ -1290,7 +1290,7 @@ EOF test_done "$testroot" "$ret" return 1 fi - + echo 'Connecting to "origin" 127.0.0.1' > $testroot/stdout.expected echo "Already up-to-date" >> $testroot/stdout.expected cmp -s $testroot/stdout $testroot/stdout.expected @@ -1473,7 +1473,7 @@ EOF test_done "$testroot" "$ret" return 1 fi - + got branch -r $testroot/repo foo got send -q -r $testroot/repo > $testroot/stdout 2> $testroot/stderr blob - aa7ab6a4d503709b02e2b21c93c311366d9d0c21 blob + f300dcfe4401545c0f39a9579a7a85f13abf3aba --- regress/cmdline/status.sh +++ regress/cmdline/status.sh @@ -566,7 +566,7 @@ test_status_cvsignore() { test_done "$testroot" "$ret" return 1 fi - + echo -n '' > $testroot/stdout.expected (cd $testroot/wt && got status epsilon/new > $testroot/stdout) blob - d39141fb12a51b418ec658816ffb680669c89938 blob + 5e848211fb214dcf85821630b0ddfec124dc7502 --- util/got-build-regress.sh +++ util/got-build-regress.sh @@ -38,7 +38,7 @@ while [ $# -ne 0 ]; do force=1; shift;; -w) worktree="$2"; shift; shift;; - -r) + -r) fromaddr_arg="-r $2"; shift; shift;; -R) testroot="$2"; shift; shift;;