Thread (25 messages) flat view 25 messages, 3 authors, 2017-01-02

Re: [PATCH 09/17] builtin/merge: convert to struct object_id

From: Michael Haggerty <hidden>
Date: 2017-01-02 14:34:37

On 01/01/2017 08:18 PM, brian m. carlson wrote:
quoted hunk ↗ jump to hunk
Additionally convert several uses of the constant 40 into
GIT_SHA1_HEXSZ.

Signed-off-by: brian m. carlson <redacted>
---
 builtin/merge.c | 136 ++++++++++++++++++++++++++++----------------------------
 1 file changed, 68 insertions(+), 68 deletions(-)

[...]
@@ -437,25 +437,25 @@ static void merge_name(const char *remote, struct strbuf *msg)
 	strbuf_branchname(&bname, remote);
 	remote = bname.buf;
 
-	memset(branch_head, 0, sizeof(branch_head));
+	memset(&branch_head, 0, sizeof(branch_head));
I think this could be

        oidclr(&branch_head);
quoted hunk ↗ jump to hunk
 	remote_head = get_merge_parent(remote);
 	if (!remote_head)
 		die(_("'%s' does not point to a commit"), remote);
[...]
@@ -1113,9 +1113,9 @@ static struct commit_list *collect_parents(struct commit *head_commit,
 
 int cmd_merge(int argc, const char **argv, const char *prefix)
 {
-	unsigned char result_tree[20];
-	unsigned char stash[20];
-	unsigned char head_sha1[20];
+	struct object_id result_tree;
+	struct object_id stash;
+	struct object_id head_oid;
These could comfortably be declared on a single line now.
 	struct commit *head_commit;
 	struct strbuf buf = STRBUF_INIT;
 	const char *head_arg;
[...]
Michael
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help