rebase -i: use struct object_id for squash_onto
More preparation for using `struct rebase_options` in cmd_rebase__interactive(). Using a string was a hangover from the scripted version of rebase, update the functions that use `squash_onto` to take a `sturct object_id`. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
7d3488eb89
commit
338985317e
@ -129,6 +129,23 @@ int parse_opt_object_name(const struct option *opt, const char *arg, int unset)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int parse_opt_object_id(const struct option *opt, const char *arg, int unset)
|
||||
{
|
||||
struct object_id oid;
|
||||
struct object_id *target = opt->value;
|
||||
|
||||
if (unset) {
|
||||
*target = null_oid;
|
||||
return 0;
|
||||
}
|
||||
if (!arg)
|
||||
return -1;
|
||||
if (get_oid(arg, &oid))
|
||||
return error(_("malformed object name '%s'"), arg);
|
||||
*target = oid;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int parse_opt_tertiary(const struct option *opt, const char *arg, int unset)
|
||||
{
|
||||
int *target = opt->value;
|
||||
|
Reference in New Issue
Block a user