Commit f2c16586bf7eef0299baac130ef7b91666023712

Stefan Sperling 2019-05-09T13:50:52

update HEAD reference after commit

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/lib/worktree.c b/lib/worktree.c
index ef2e470..d2d1a1e 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -2806,6 +2806,13 @@ got_worktree_commit(struct got_object_id **new_commit_id,
 	if (err)
 		goto done;
 
+	err = got_ref_change_ref(worktree->head_ref, *new_commit_id);
+	if (err)
+		goto done;
+	err = got_ref_write(worktree->head_ref, repo);
+	if (err)
+		goto done;
+
 	err = ref_base_commit(worktree, repo);
 	if (err)
 		goto done;