Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
builtin/notes: convert static functions to object_id
author
brian m. carlson
<sandals@crustytoothpaste.net>
Mon, 12 Mar 2018 02:27:48 +0000
(
02:27
+0000)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 14 Mar 2018 16:23:50 +0000
(09:23 -0700)
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>
builtin/notes.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
f8ddeff
)
diff --git
a/builtin/notes.c
b/builtin/notes.c
index 39304ba743b34ad9ff73583f691c6f8d79379eb5..08ab9d7130e2ab0998fb65caa9b9eebde8e66435 100644
(file)
--- a/
builtin/notes.c
+++ b/
builtin/notes.c
@@
-118,11
+118,11
@@
static int list_each_note(const struct object_id *object_oid,
return 0;
}
return 0;
}
-static void copy_obj_to_fd(int fd, const
unsigned char *sha1
)
+static void copy_obj_to_fd(int fd, const
struct object_id *oid
)
{
unsigned long size;
enum object_type type;
{
unsigned long size;
enum object_type type;
- char *buf = read_sha1_file(
sha1
, &type, &size);
+ char *buf = read_sha1_file(
oid->hash
, &type, &size);
if (buf) {
if (size)
write_or_die(fd, buf, size);
if (buf) {
if (size)
write_or_die(fd, buf, size);
@@
-162,7
+162,7
@@
static void write_commented_object(int fd, const struct object_id *object)
}
static void prepare_note_data(const struct object_id *object, struct note_data *d,
}
static void prepare_note_data(const struct object_id *object, struct note_data *d,
- const
unsigned char
*old_note)
+ const
struct object_id
*old_note)
{
if (d->use_editor || !d->given) {
int fd;
{
if (d->use_editor || !d->given) {
int fd;
@@
-457,7
+457,7
@@
static int add(int argc, const char **argv, const char *prefix)
oid_to_hex(&object));
}
oid_to_hex(&object));
}
- prepare_note_data(&object, &d, note
? note->hash : NULL
);
+ prepare_note_data(&object, &d, note);
if (d.buf.len || allow_empty) {
write_note_data(&d, &new_note);
if (add_note(t, &object, &new_note, combine_notes_overwrite))
if (d.buf.len || allow_empty) {
write_note_data(&d, &new_note);
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)
t = init_notes_check(argv[0], NOTES_INIT_WRITABLE);
note = get_note(t, &object);
t = init_notes_check(argv[0], NOTES_INIT_WRITABLE);
note = get_note(t, &object);
- prepare_note_data(&object, &d, edit && note ? note
->hash
: NULL);
+ prepare_note_data(&object, &d, edit && note ? note : NULL);
if (note && !edit) {
/* Append buf to previous note contents */
if (note && !edit) {
/* Append buf to previous note contents */