commit 675c7539c677a208d43573b3459ac144e7739b09 from: Stefan Sperling date: Thu May 09 19:36:10 2019 UTC do status walk before opening base commit/tree commit - a855e33f642b396e376f7933c47e61053f1902ee commit + 675c7539c677a208d43573b3459ac144e7739b09 blob - a6554be62b8f3392936b89f049ae18a03c7d251c blob + c1378d1455646e94cbb9862257c7c43f063eab0c --- lib/worktree.c +++ lib/worktree.c @@ -2260,6 +2260,13 @@ got_worktree_commit(struct got_object_id **new_commit_ err = lock_worktree(worktree, LOCK_EX); if (err) goto done; + + err = got_worktree_status(worktree, relpath ? relpath : "", + repo, collect_committables, &paths, NULL, NULL); + if (err) + goto done; + + /* TODO: collect commit message if not specified */ err = got_object_open_as_commit(&base_commit, repo, worktree->base_commit_id); @@ -2270,13 +2277,6 @@ got_worktree_commit(struct got_object_id **new_commit_ if (err) goto done; - err = got_worktree_status(worktree, relpath ? relpath : "", - repo, collect_committables, &paths, NULL, NULL); - if (err) - goto done; - - /* TODO: collect commit message if not specified */ - /* TODO: walk base tree and patch it to create a new tree */ printf("committables:\n"); TAILQ_FOREACH(pe, &paths, entry) {