summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-05-26 12:42:43 -0500
committerEdward Thomson <ethomson@github.com>2016-06-01 10:03:52 -0500
commit4505a42a23cfb55fcfd88d89d150686a78636805 (patch)
tree91913f2a366f8890dc6b3fc115e81a9d7d7c56c5
parente3c42fee7732c9e06fde4f5a8942a454e4514319 (diff)
downloadlibgit2-4505a42a23cfb55fcfd88d89d150686a78636805.tar.gz
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.
-rw-r--r--src/rebase.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/rebase.c b/src/rebase.c
index 9f3b6ec6e..470e62a23 100644
--- a/src/rebase.c
+++ b/src/rebase.c
@@ -1047,15 +1047,12 @@ static int rebase_commit_inmemory(
const char *message_encoding,
const char *message)
{
- git_rebase_operation *operation;
git_commit *commit = NULL;
int error = 0;
- operation = git_array_get(rebase->operations, rebase->current);
-
- assert(operation);
assert(rebase->index);
assert(rebase->last_commit);
+ assert(rebase->current < rebase->operations.size);
if ((error = rebase_commit__create(&commit, rebase, rebase->index,
rebase->last_commit, author, committer, message_encoding, message)) < 0)