notes: convert combine_notes_* to object_id
Convert the definition and declarations of combine_notes_* functions to struct object_id and adjust usage of these functions. Signed-off-by: Patryk Obara <patryk.obara@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
5078f34459
commit
b7d591d17b
25
notes.h
25
notes.h
@@ -9,27 +9,32 @@
|
||||
* When adding a new note annotating the same object as an existing note, it is
|
||||
* up to the caller to decide how to combine the two notes. The decision is
|
||||
* made by passing in a function of the following form. The function accepts
|
||||
* two SHA1s -- of the existing note and the new note, respectively. The
|
||||
* two object_ids -- of the existing note and the new note, respectively. The
|
||||
* function then combines the notes in whatever way it sees fit, and writes the
|
||||
* resulting SHA1 into the first SHA1 argument (cur_sha1). A non-zero return
|
||||
* resulting oid into the first argument (cur_oid). A non-zero return
|
||||
* value indicates failure.
|
||||
*
|
||||
* The two given SHA1s shall both be non-NULL and different from each other.
|
||||
* Either of them (but not both) may be == null_sha1, which indicates an
|
||||
* empty/non-existent note. If the resulting SHA1 (cur_sha1) is == null_sha1,
|
||||
* The two given object_ids shall both be non-NULL and different from each
|
||||
* other. Either of them (but not both) may be == null_oid, which indicates an
|
||||
* empty/non-existent note. If the resulting oid (cur_oid) is == null_oid,
|
||||
* the note will be removed from the notes tree.
|
||||
*
|
||||
* The default combine_notes function (you get this when passing NULL) is
|
||||
* combine_notes_concatenate(), which appends the contents of the new note to
|
||||
* the contents of the existing note.
|
||||
*/
|
||||
typedef int (*combine_notes_fn)(unsigned char *cur_sha1, const unsigned char *new_sha1);
|
||||
typedef int (*combine_notes_fn)(struct object_id *cur_oid,
|
||||
const struct object_id *new_oid);
|
||||
|
||||
/* Common notes combinators */
|
||||
int combine_notes_concatenate(unsigned char *cur_sha1, const unsigned char *new_sha1);
|
||||
int combine_notes_overwrite(unsigned char *cur_sha1, const unsigned char *new_sha1);
|
||||
int combine_notes_ignore(unsigned char *cur_sha1, const unsigned char *new_sha1);
|
||||
int combine_notes_cat_sort_uniq(unsigned char *cur_sha1, const unsigned char *new_sha1);
|
||||
int combine_notes_concatenate(struct object_id *cur_oid,
|
||||
const struct object_id *new_oid);
|
||||
int combine_notes_overwrite(struct object_id *cur_oid,
|
||||
const struct object_id *new_oid);
|
||||
int combine_notes_ignore(struct object_id *cur_oid,
|
||||
const struct object_id *new_oid);
|
||||
int combine_notes_cat_sort_uniq(struct object_id *cur_oid,
|
||||
const struct object_id *new_oid);
|
||||
|
||||
/*
|
||||
* Notes tree object
|
||||
|
||||
Reference in New Issue
Block a user