Commit c2cf9844a2b936880df021101f7ecd26e87d0a04

Etienne Samson 2019-02-02T19:00:43

refdb: check the version of the backend we're about to set

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/refdb.c b/src/refdb.c
index b466153..e0c044f 100644
--- a/src/refdb.c
+++ b/src/refdb.c
@@ -66,6 +66,8 @@ static void refdb_free_backend(git_refdb *db)
 
 int git_refdb_set_backend(git_refdb *db, git_refdb_backend *backend)
 {
+	GIT_ERROR_CHECK_VERSION(backend, GIT_REFDB_BACKEND_VERSION, "git_refdb_backend");
+
 	refdb_free_backend(db);
 	db->backend = backend;