Skip to content

Commit e5975f3

Browse files
committed
tests: reset odb backend priority
1 parent e87bcb3 commit e5975f3

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/odb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
* We work under the assumption that most objects for long-running
3030
* operations will be packed
3131
*/
32-
int git_odb__loose_priority = 1;
33-
int git_odb__packed_priority = 2;
32+
int git_odb__loose_priority = GIT_ODB_DEFAULT_LOOSE_PRIORITY;
33+
int git_odb__packed_priority = GIT_ODB_DEFAULT_PACKED_PRIORITY;
3434

3535
bool git_odb__strict_hash_verification = true;
3636

src/odb.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
#define GIT_OBJECT_DIR_MODE 0777
2525
#define GIT_OBJECT_FILE_MODE 0444
2626

27+
#define GIT_ODB_DEFAULT_LOOSE_PRIORITY 1
28+
#define GIT_ODB_DEFAULT_PACKED_PRIORITY 2
29+
2730
extern bool git_odb__strict_hash_verification;
2831

2932
/* DO NOT EXPORT */

tests/odb/sorting.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "clar_libgit2.h"
22
#include "git2/sys/odb_backend.h"
3+
#include "odb.h"
34

45
typedef struct {
56
git_odb_backend base;
@@ -43,6 +44,11 @@ void test_odb_sorting__cleanup(void)
4344
{
4445
git_odb_free(_odb);
4546
_odb = NULL;
47+
48+
cl_git_pass(git_libgit2_opts(GIT_OPT_SET_ODB_LOOSE_PRIORITY,
49+
GIT_ODB_DEFAULT_LOOSE_PRIORITY));
50+
cl_git_pass(git_libgit2_opts(GIT_OPT_SET_ODB_PACKED_PRIORITY,
51+
GIT_ODB_DEFAULT_PACKED_PRIORITY));
4652
}
4753

4854
void test_odb_sorting__basic_backends_sorting(void)

0 commit comments

Comments
 (0)