Commit 51c32763c2da763dfd11ac3644cd54c6099d673d

Stefan Sperling 2019-05-07T20:58:58

fix bogus sha1 calculation in got_object_tree_create()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/object_create.c b/lib/object_create.c
index 4d5481f..8c94148 100644
--- a/lib/object_create.c
+++ b/lib/object_create.c
@@ -222,6 +222,8 @@ got_object_tree_create(struct got_object_id **id,
 
 	*id = NULL;
 
+	SHA1Init(&sha1_ctx);
+
 	SIMPLEQ_FOREACH(te, &entries->head, entry) {
 		err = mode2str(modebuf, sizeof(modebuf), te->mode);
 		if (err)