git-update: Close cursor before closing database

When using SQLite as backend, we need to close the cursor before closing
the database to avoid the following error:

    sqlite3.OperationalError: unable to close due to unfinalized statements or unfinished backups

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Lukas Fleischer 2016-08-22 08:12:07 +02:00
parent c761631181
commit 29625e0744
2 changed files with 2 additions and 1 deletions

View file

@ -402,4 +402,5 @@ repo.create_reference('refs/namespaces/' + pkgbase + '/HEAD', sha1_new, True)
update_notify(conn, user, pkgbase_id)
# Close the database.
cur.close()
conn.close()

View file

@ -368,7 +368,7 @@ test_expect_success 'Pushing a blacklisted package.' '
test_cmp expected actual
'
test_expect_failure 'Pushing a blacklisted package as Trusted User.' '
test_expect_success 'Pushing a blacklisted package as Trusted User.' '
old=$(git -C aur.git rev-parse HEAD) &&
test_when_finished "git -C aur.git reset --hard $old" &&
echo "pkgname = forbidden" >>aur.git/.SRCINFO &&