summaryrefslogtreecommitdiff
path: root/fsck.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-07-25 14:13:44 -0700
committerJunio C Hamano <gitster@pobox.com>2016-07-25 14:13:44 -0700
commit9db397978416f9d562a94e55db86c7a45210a05c (patch)
tree7229b749a1f9eefe19a522fe5a5b4d0f18bea8b2 /fsck.h
parent3cc75c10d781572a073d7dbff4e1695b93a89d48 (diff)
parent90cf590f53f2939a47ca7b397e270e8228699829 (diff)
downloadgit-9db397978416f9d562a94e55db86c7a45210a05c.tar.gz
Merge branch 'js/fsck-name-object'
When "git fsck" reports a broken link (e.g. a tree object contains a blob that does not exist), both containing object and the object that is referred to were reported with their 40-hex object names. The command learned the "--name-objects" option to show the path to the containing object from existing refs (e.g. "HEAD~24^2:file.txt"). * js/fsck-name-object: fsck: optionally show more helpful info for broken links fsck: give the error function a chance to see the fsck_options fsck_walk(): optionally name objects on the go fsck: refactor how to describe objects
Diffstat (limited to 'fsck.h')
-rw-r--r--fsck.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/fsck.h b/fsck.h
index dded84b5f9..1891c1863b 100644
--- a/fsck.h
+++ b/fsck.h
@@ -23,9 +23,11 @@ int is_valid_msg_type(const char *msg_id, const char *msg_type);
typedef int (*fsck_walk_func)(struct object *obj, int type, void *data, struct fsck_options *options);
/* callback for fsck_object, type is FSCK_ERROR or FSCK_WARN */
-typedef int (*fsck_error)(struct object *obj, int type, const char *message);
+typedef int (*fsck_error)(struct fsck_options *o,
+ struct object *obj, int type, const char *message);
-int fsck_error_function(struct object *obj, int type, const char *message);
+int fsck_error_function(struct fsck_options *o,
+ struct object *obj, int type, const char *message);
struct fsck_options {
fsck_walk_func walk;
@@ -33,6 +35,7 @@ struct fsck_options {
unsigned strict:1;
int *msg_type;
struct sha1_array *skiplist;
+ struct decoration *object_names;
};
#define FSCK_OPTIONS_DEFAULT { NULL, fsck_error_function, 0, NULL }