diff options
Diffstat (limited to 'builtin/commit-graph.c')
-rw-r--r-- | builtin/commit-graph.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c index 2857153008..9ceedbba07 100644 --- a/builtin/commit-graph.c +++ b/builtin/commit-graph.c @@ -11,7 +11,7 @@ static char const * const builtin_commit_graph_usage[] = { N_("git commit-graph verify [--object-dir <objdir>] [--shallow] [--[no-]progress]"), N_("git commit-graph write [--object-dir <objdir>] [--append] " "[--split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits] " - "[--[no-]progress] [--[no-]check-oids] <split options>"), + "[--[no-]progress] <split options>"), NULL }; @@ -23,7 +23,7 @@ static const char * const builtin_commit_graph_verify_usage[] = { static const char * const builtin_commit_graph_write_usage[] = { N_("git commit-graph write [--object-dir <objdir>] [--append] " "[--split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits] " - "[--[no-]progress] [--[no-]check-oids] <split options>"), + "[--[no-]progress] <split options>"), NULL }; @@ -36,7 +36,6 @@ static struct opts_commit_graph { int split; int shallow; int progress; - int check_oids; } opts; static struct object_directory *find_odb(struct repository *r, @@ -44,14 +43,17 @@ static struct object_directory *find_odb(struct repository *r, { struct object_directory *odb; char *obj_dir_real = real_pathdup(obj_dir, 1); + struct strbuf odb_path_real = STRBUF_INIT; prepare_alt_odb(r); for (odb = r->objects->odb; odb; odb = odb->next) { - if (!strcmp(obj_dir_real, real_path(odb->path))) + strbuf_realpath(&odb_path_real, odb->path, 1); + if (!strcmp(obj_dir_real, odb_path_real.buf)) break; } free(obj_dir_real); + strbuf_release(&odb_path_real); if (!odb) die(_("could not find object directory matching %s"), obj_dir); @@ -161,19 +163,16 @@ static int graph_write(int argc, const char **argv) N_("allow writing an incremental commit-graph file"), PARSE_OPT_OPTARG | PARSE_OPT_NONEG, write_option_parse_split), - OPT_BOOL(0, "check-oids", &opts.check_oids, - N_("require OIDs to be commits")), OPT_INTEGER(0, "max-commits", &split_opts.max_commits, N_("maximum number of commits in a non-base split commit-graph")), OPT_INTEGER(0, "size-multiple", &split_opts.size_multiple, N_("maximum ratio between two levels of a split commit-graph")), OPT_EXPIRY_DATE(0, "expire-time", &split_opts.expire_time, - N_("maximum number of commits in a non-base split commit-graph")), + N_("only expire files older than a given date-time")), OPT_END(), }; opts.progress = isatty(2); - opts.check_oids = 1; split_opts.size_multiple = 2; split_opts.max_commits = 0; split_opts.expire_time = 0; @@ -228,8 +227,7 @@ static int graph_write(int argc, const char **argv) oidset_insert(&commits, &oid); } - if (opts.check_oids) - flags |= COMMIT_GRAPH_WRITE_CHECK_OIDS; + flags |= COMMIT_GRAPH_WRITE_CHECK_OIDS; } UNLEAK(buf); |