hash.h: move some oid-related declarations from cache.h
These defines and enum are all oid-related and as such seem to make more sense being included in hash.h. Further, moving them there allows us to remove some includes of cache.h in other files. The change to line-log.h might look unrelated, but line-log.h includes diffcore.h, which previously included cache.h, which included the kitchen sink. Since this patch makes diffcore.h no longer include cache.h, the compiler complains about the 'struct string_list *' function parameter. Add a forward declaration for struct string_list to address this. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
36bf195890
commit
41227cb138
34
cache.h
34
cache.h
@ -1363,40 +1363,6 @@ struct object_context {
|
|||||||
char *path;
|
char *path;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define GET_OID_QUIETLY 01
|
|
||||||
#define GET_OID_COMMIT 02
|
|
||||||
#define GET_OID_COMMITTISH 04
|
|
||||||
#define GET_OID_TREE 010
|
|
||||||
#define GET_OID_TREEISH 020
|
|
||||||
#define GET_OID_BLOB 040
|
|
||||||
#define GET_OID_FOLLOW_SYMLINKS 0100
|
|
||||||
#define GET_OID_RECORD_PATH 0200
|
|
||||||
#define GET_OID_ONLY_TO_DIE 04000
|
|
||||||
#define GET_OID_REQUIRE_PATH 010000
|
|
||||||
|
|
||||||
#define GET_OID_DISAMBIGUATORS \
|
|
||||||
(GET_OID_COMMIT | GET_OID_COMMITTISH | \
|
|
||||||
GET_OID_TREE | GET_OID_TREEISH | \
|
|
||||||
GET_OID_BLOB)
|
|
||||||
|
|
||||||
enum get_oid_result {
|
|
||||||
FOUND = 0,
|
|
||||||
MISSING_OBJECT = -1, /* The requested object is missing */
|
|
||||||
SHORT_NAME_AMBIGUOUS = -2,
|
|
||||||
/* The following only apply when symlinks are followed */
|
|
||||||
DANGLING_SYMLINK = -4, /*
|
|
||||||
* The initial symlink is there, but
|
|
||||||
* (transitively) points to a missing
|
|
||||||
* in-tree file
|
|
||||||
*/
|
|
||||||
SYMLINK_LOOP = -5,
|
|
||||||
NOT_DIR = -6, /*
|
|
||||||
* Somewhere along the symlink chain, a path is
|
|
||||||
* requested which contains a file as a
|
|
||||||
* non-final element.
|
|
||||||
*/
|
|
||||||
};
|
|
||||||
|
|
||||||
int repo_get_oid(struct repository *r, const char *str, struct object_id *oid);
|
int repo_get_oid(struct repository *r, const char *str, struct object_id *oid);
|
||||||
__attribute__((format (printf, 2, 3)))
|
__attribute__((format (printf, 2, 3)))
|
||||||
int get_oidf(struct object_id *oid, const char *fmt, ...);
|
int get_oidf(struct object_id *oid, const char *fmt, ...);
|
||||||
|
@ -4,9 +4,11 @@
|
|||||||
#ifndef DIFFCORE_H
|
#ifndef DIFFCORE_H
|
||||||
#define DIFFCORE_H
|
#define DIFFCORE_H
|
||||||
|
|
||||||
#include "cache.h"
|
#include "hash.h"
|
||||||
|
|
||||||
struct diff_options;
|
struct diff_options;
|
||||||
|
struct mem_pool;
|
||||||
|
struct oid_array;
|
||||||
struct repository;
|
struct repository;
|
||||||
struct strintmap;
|
struct strintmap;
|
||||||
struct strmap;
|
struct strmap;
|
||||||
|
34
hash.h
34
hash.h
@ -123,6 +123,40 @@ struct object_id {
|
|||||||
int algo; /* XXX requires 4-byte alignment */
|
int algo; /* XXX requires 4-byte alignment */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define GET_OID_QUIETLY 01
|
||||||
|
#define GET_OID_COMMIT 02
|
||||||
|
#define GET_OID_COMMITTISH 04
|
||||||
|
#define GET_OID_TREE 010
|
||||||
|
#define GET_OID_TREEISH 020
|
||||||
|
#define GET_OID_BLOB 040
|
||||||
|
#define GET_OID_FOLLOW_SYMLINKS 0100
|
||||||
|
#define GET_OID_RECORD_PATH 0200
|
||||||
|
#define GET_OID_ONLY_TO_DIE 04000
|
||||||
|
#define GET_OID_REQUIRE_PATH 010000
|
||||||
|
|
||||||
|
#define GET_OID_DISAMBIGUATORS \
|
||||||
|
(GET_OID_COMMIT | GET_OID_COMMITTISH | \
|
||||||
|
GET_OID_TREE | GET_OID_TREEISH | \
|
||||||
|
GET_OID_BLOB)
|
||||||
|
|
||||||
|
enum get_oid_result {
|
||||||
|
FOUND = 0,
|
||||||
|
MISSING_OBJECT = -1, /* The requested object is missing */
|
||||||
|
SHORT_NAME_AMBIGUOUS = -2,
|
||||||
|
/* The following only apply when symlinks are followed */
|
||||||
|
DANGLING_SYMLINK = -4, /*
|
||||||
|
* The initial symlink is there, but
|
||||||
|
* (transitively) points to a missing
|
||||||
|
* in-tree file
|
||||||
|
*/
|
||||||
|
SYMLINK_LOOP = -5,
|
||||||
|
NOT_DIR = -6, /*
|
||||||
|
* Somewhere along the symlink chain, a path is
|
||||||
|
* requested which contains a file as a
|
||||||
|
* non-final element.
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
|
||||||
/* A suitably aligned type for stack allocations of hash contexts. */
|
/* A suitably aligned type for stack allocations of hash contexts. */
|
||||||
union git_hash_ctx {
|
union git_hash_ctx {
|
||||||
git_SHA_CTX sha1;
|
git_SHA_CTX sha1;
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
struct rev_info;
|
struct rev_info;
|
||||||
struct commit;
|
struct commit;
|
||||||
|
struct string_list;
|
||||||
|
|
||||||
/* A range [start,end]. Lines are numbered starting at 0, and the
|
/* A range [start,end]. Lines are numbered starting at 0, and the
|
||||||
* ranges include start but exclude end. */
|
* ranges include start but exclude end. */
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#ifndef SUBMODULE_CONFIG_CACHE_H
|
#ifndef SUBMODULE_CONFIG_CACHE_H
|
||||||
#define SUBMODULE_CONFIG_CACHE_H
|
#define SUBMODULE_CONFIG_CACHE_H
|
||||||
|
|
||||||
#include "cache.h"
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "hashmap.h"
|
#include "hashmap.h"
|
||||||
#include "submodule.h"
|
#include "submodule.h"
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include "test-tool.h"
|
#include "test-tool.h"
|
||||||
|
#include "cache.h"
|
||||||
#include "submodule-config.h"
|
#include "submodule-config.h"
|
||||||
|
|
||||||
static void die_usage(const char **argv, const char *msg)
|
static void die_usage(const char **argv, const char *msg)
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
#ifndef TREE_WALK_H
|
#ifndef TREE_WALK_H
|
||||||
#define TREE_WALK_H
|
#define TREE_WALK_H
|
||||||
|
|
||||||
#include "cache.h"
|
#include "hash.h"
|
||||||
|
|
||||||
|
struct index_state;
|
||||||
|
|
||||||
#define MAX_TRAVERSE_TREES 8
|
#define MAX_TRAVERSE_TREES 8
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user