Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4505a42

Browse files
author
Edward Thomson
committed
rebase: change assertion to avoid
It looks like we're getting the operation and not doing anything with it, when in fact we are asserting that it's not null. Simply assert that we are within the operation boundary instead of using the `git_array_get` macro to do this for us.
1 parent e3c42fe commit 4505a42

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/rebase.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,15 +1047,12 @@ static int rebase_commit_inmemory(
10471047
const char *message_encoding,
10481048
const char *message)
10491049
{
1050-
git_rebase_operation *operation;
10511050
git_commit *commit = NULL;
10521051
int error = 0;
10531052

1054-
operation = git_array_get(rebase->operations, rebase->current);
1055-
1056-
assert(operation);
10571053
assert(rebase->index);
10581054
assert(rebase->last_commit);
1055+
assert(rebase->current < rebase->operations.size);
10591056

10601057
if ((error = rebase_commit__create(&commit, rebase, rebase->index,
10611058
rebase->last_commit, author, committer, message_encoding, message)) < 0)

0 commit comments

Comments
 (0)