rebase -i: watch out for invalid upstream arguments

This was overlooked in 53bbcfbde7 (rebase -i: implement the main part
of interactive rebase as a builtin, 2018-09-27).

Found by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2019-05-09 12:25:16 +02:00
parent fd442be344
commit d451e84f20

View File

@@ -33,7 +33,8 @@ static int get_revision_ranges(const char *upstream, const char *onto,
const char *shortrev;
struct object_id rev_oid;
get_oid(base_rev, &rev_oid);
if (get_oid(base_rev, &rev_oid) < 0)
return error(_("invalid rev '%s'"), base_rev);
shortrev = find_unique_abbrev(&rev_oid, DEFAULT_ABBREV);
*shortrevisions = xstrfmt("%s..%s", shortrev, shorthead);