Implement a new caching system to make repeated runs much much faster.
This commit is contained in:
parent
4a008a82b0
commit
5e0e140b09
8 changed files with 252 additions and 44 deletions
37
hash.h
Normal file
37
hash.h
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <git2/repository.h>
|
||||
|
||||
#ifdef GIT
|
||||
typedef struct {
|
||||
uint64_t hash;
|
||||
bool changes;
|
||||
} repohash;
|
||||
|
||||
#define XD_HASH_PATH "/XDhash"
|
||||
/**
|
||||
* @brief generate a hash from the repository state
|
||||
*
|
||||
* @param repo the git repository
|
||||
* @return the hash
|
||||
*/
|
||||
uint64_t generate_hash(git_repository *repo);
|
||||
|
||||
/**
|
||||
* @brief read the hash from the git repo
|
||||
*
|
||||
* @param repo the git repository
|
||||
* @return the hash
|
||||
*/
|
||||
repohash *read_hash(git_repository *repo);
|
||||
|
||||
/**
|
||||
* @brief write a new hash to the repository
|
||||
*
|
||||
* @param repo the repository
|
||||
* @param hash the hash to write
|
||||
*/
|
||||
int write_hash(git_repository *repo, repohash hash);
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue