Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
notes: convert init_notes to use struct object_id
author
brian m. carlson
<sandals@crustytoothpaste.net>
Mon, 5 Sep 2016 20:08:05 +0000
(20:08 +0000)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 7 Sep 2016 19:59:42 +0000
(12:59 -0700)
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
notes.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
8ec46d7
)
diff --git
a/notes.c
b/notes.c
index df4660fe62ae64356950ca51c1acead0398f93f1..2bab961ac122e4da1f7b4a4c4398ac8c72fdfae5 100644
(file)
--- a/
notes.c
+++ b/
notes.c
@@
-993,7
+993,7
@@
const char *default_notes_ref(void)
void init_notes(struct notes_tree *t, const char *notes_ref,
combine_notes_fn combine_notes, int flags)
{
void init_notes(struct notes_tree *t, const char *notes_ref,
combine_notes_fn combine_notes, int flags)
{
-
unsigned char sha1[20], object_sha1[20]
;
+
struct object_id oid, object_oid
;
unsigned mode;
struct leaf_node root_tree;
unsigned mode;
struct leaf_node root_tree;
@@
-1017,16
+1017,16
@@
void init_notes(struct notes_tree *t, const char *notes_ref,
t->dirty = 0;
if (flags & NOTES_INIT_EMPTY || !notes_ref ||
t->dirty = 0;
if (flags & NOTES_INIT_EMPTY || !notes_ref ||
- get_sha1_treeish(notes_ref, object_
sha1
))
+ get_sha1_treeish(notes_ref, object_
oid.hash
))
return;
return;
- if (flags & NOTES_INIT_WRITABLE && read_ref(notes_ref, object_
sha1
))
+ if (flags & NOTES_INIT_WRITABLE && read_ref(notes_ref, object_
oid.hash
))
die("Cannot use notes ref %s", notes_ref);
die("Cannot use notes ref %s", notes_ref);
- if (get_tree_entry(object_
sha1, "", sha1
, &mode))
+ if (get_tree_entry(object_
oid.hash, "", oid.hash
, &mode))
die("Failed to read notes tree referenced by %s (%s)",
die("Failed to read notes tree referenced by %s (%s)",
- notes_ref,
sha1_to_hex(object_sha1
));
+ notes_ref,
oid_to_hex(&object_oid
));
hashclr(root_tree.key_sha1);
hashclr(root_tree.key_sha1);
- hashcpy(root_tree.val_sha1,
sha1
);
+ hashcpy(root_tree.val_sha1,
oid.hash
);
load_subtree(t, &root_tree, t->root, 0);
}
load_subtree(t, &root_tree, t->root, 0);
}