Skip to content

Commit e8adba2

Browse files
bk2204gitster
authored andcommitted
builtin/notes: convert static functions to object_id
Convert the remaining static functions to take pointers to struct object_id. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent f8ddeff commit e8adba2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

builtin/notes.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ static int list_each_note(const struct object_id *object_oid,
118118
return 0;
119119
}
120120

121-
static void copy_obj_to_fd(int fd, const unsigned char *sha1)
121+
static void copy_obj_to_fd(int fd, const struct object_id *oid)
122122
{
123123
unsigned long size;
124124
enum object_type type;
125-
char *buf = read_sha1_file(sha1, &type, &size);
125+
char *buf = read_sha1_file(oid->hash, &type, &size);
126126
if (buf) {
127127
if (size)
128128
write_or_die(fd, buf, size);
@@ -162,7 +162,7 @@ static void write_commented_object(int fd, const struct object_id *object)
162162
}
163163

164164
static void prepare_note_data(const struct object_id *object, struct note_data *d,
165-
const unsigned char *old_note)
165+
const struct object_id *old_note)
166166
{
167167
if (d->use_editor || !d->given) {
168168
int fd;
@@ -457,7 +457,7 @@ static int add(int argc, const char **argv, const char *prefix)
457457
oid_to_hex(&object));
458458
}
459459

460-
prepare_note_data(&object, &d, note ? note->hash : NULL);
460+
prepare_note_data(&object, &d, note);
461461
if (d.buf.len || allow_empty) {
462462
write_note_data(&d, &new_note);
463463
if (add_note(t, &object, &new_note, combine_notes_overwrite))
@@ -602,7 +602,7 @@ static int append_edit(int argc, const char **argv, const char *prefix)
602602
t = init_notes_check(argv[0], NOTES_INIT_WRITABLE);
603603
note = get_note(t, &object);
604604

605-
prepare_note_data(&object, &d, edit && note ? note->hash : NULL);
605+
prepare_note_data(&object, &d, edit && note ? note : NULL);
606606

607607
if (note && !edit) {
608608
/* Append buf to previous note contents */

0 commit comments

Comments
 (0)