Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
notes-merge: convert verify_notes_filepair to struct object_id
author
Brandon Williams
<bmwill@google.com>
Tue, 30 May 2017 17:31:01 +0000
(10:31 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 5 Jun 2017 02:23:58 +0000
(11:23 +0900)
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
notes-merge.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
d7a7c70
)
diff --git
a/notes-merge.c
b/notes-merge.c
index 55dbb3659eb31e084052d8234664a0e29f6dbb8e..962e9b1bcad348d6bf77fe59a78276371698497e 100644
(file)
--- a/
notes-merge.c
+++ b/
notes-merge.c
@@
-22,21
+22,21
@@
void init_notes_merge_options(struct notes_merge_options *o)
o->verbosity = NOTES_MERGE_VERBOSITY_DEFAULT;
}
o->verbosity = NOTES_MERGE_VERBOSITY_DEFAULT;
}
-static int path_to_
sha1(const char *path, unsigned char *sha1
)
+static int path_to_
oid(const char *path, struct object_id *oid
)
{
{
- char hex_
sha1[40
];
+ char hex_
oid[GIT_SHA1_HEXSZ
];
int i = 0;
int i = 0;
- while (*path && i <
40
) {
+ while (*path && i <
GIT_SHA1_HEXSZ
) {
if (*path != '/')
if (*path != '/')
- hex_
sha1
[i++] = *path;
+ hex_
oid
[i++] = *path;
path++;
}
path++;
}
- if (*path || i !=
40
)
+ if (*path || i !=
GIT_SHA1_HEXSZ
)
return -1;
return -1;
- return get_
sha1_hex(hex_sha1, sha1
);
+ return get_
oid_hex(hex_oid, oid
);
}
}
-static int verify_notes_filepair(struct diff_filepair *p,
unsigned char *sha1
)
+static int verify_notes_filepair(struct diff_filepair *p,
struct object_id *oid
)
{
switch (p->status) {
case DIFF_STATUS_MODIFIED:
{
switch (p->status) {
case DIFF_STATUS_MODIFIED:
@@
-54,7
+54,7
@@
static int verify_notes_filepair(struct diff_filepair *p, unsigned char *sha1)
return -1;
}
assert(!strcmp(p->one->path, p->two->path));
return -1;
}
assert(!strcmp(p->one->path, p->two->path));
- return path_to_
sha1(p->one->path, sha1
);
+ return path_to_
oid(p->one->path, oid
);
}
static struct notes_merge_pair *find_notes_merge_pair_pos(
}
static struct notes_merge_pair *find_notes_merge_pair_pos(
@@
-140,7
+140,7
@@
static struct notes_merge_pair *diff_tree_remote(struct notes_merge_options *o,
int occupied;
struct object_id obj;
int occupied;
struct object_id obj;
- if (verify_notes_filepair(p,
obj.hash
)) {
+ if (verify_notes_filepair(p,
&obj
)) {
trace_printf("\t\tCannot merge entry '%s' (%c): "
"%.7s -> %.7s. Skipping!\n", p->one->path,
p->status, oid_to_hex(&p->one->oid),
trace_printf("\t\tCannot merge entry '%s' (%c): "
"%.7s -> %.7s. Skipping!\n", p->one->path,
p->status, oid_to_hex(&p->one->oid),
@@
-201,7
+201,7
@@
static void diff_tree_local(struct notes_merge_options *o,
int match;
struct object_id obj;
int match;
struct object_id obj;
- if (verify_notes_filepair(p,
obj.hash
)) {
+ if (verify_notes_filepair(p,
&obj
)) {
trace_printf("\t\tCannot merge entry '%s' (%c): "
"%.7s -> %.7s. Skipping!\n", p->one->path,
p->status, oid_to_hex(&p->one->oid),
trace_printf("\t\tCannot merge entry '%s' (%c): "
"%.7s -> %.7s. Skipping!\n", p->one->path,
p->status, oid_to_hex(&p->one->oid),