Skip to content

Commit

Permalink
moredebug
Browse files Browse the repository at this point in the history
  • Loading branch information
pks-t committed May 27, 2024
1 parent ca5d8c5 commit 2933116
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions builtin/refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,44 @@ static int cmd_refs_migrate(int argc, const char **argv, const char *prefix)
struct strbuf errbuf = STRBUF_INIT;
int err;

fputs("parse options\n", stderr);
fflush(stderr);

argc = parse_options(argc, argv, prefix, options, migrate_usage, 0);
if (argc)
usage(_("too many arguments"));
if (!format_str)
usage(_("missing --ref-format=<format>"));

fputs("ref storage format\n", stderr);
fflush(stderr);

format = ref_storage_format_by_name(format_str);
if (format == REF_STORAGE_FORMAT_UNKNOWN) {
err = error(_("unknown ref storage format '%s'"), format_str);
goto out;
}

fputs("double check\n", stderr);
fflush(stderr);

if (the_repository->ref_storage_format == format) {
err = error(_("repository already uses '%s' format"),
ref_storage_format_to_name(format));
goto out;
}

fputs("repo migrate\n", stderr);
fflush(stderr);

if (repo_migrate_ref_storage_format(the_repository, format, flags, &errbuf) < 0) {
err = error("%s", errbuf.buf);
goto out;
}

fputs("repo migrate done\n", stderr);
fflush(stderr);

err = 0;

out:
Expand Down

0 comments on commit 2933116

Please sign in to comment.