commit a097512813331d3a6c5eac85579b195a9707f114 from: Stefan Sperling date: Fri Feb 07 11:02:00 2020 UTC fix 'got blame' and 'tog blame' on files added on worktree's current branch commit - 7bf16821ab43b1b857aa86fd7e304ff383346bb2 commit + a097512813331d3a6c5eac85579b195a9707f114 blob - 676510ca36e3cd77c409fb5ebb45aab2b990ea76 blob + 4329f781964bc8101d3f2bf6cb34c09f6836eee1 --- got/got.c +++ got/got.c @@ -2623,7 +2623,8 @@ cmd_blame(int argc, char *argv[]) if (commit_id_str == NULL) { struct got_reference *head_ref; - error = got_ref_open(&head_ref, repo, GOT_REF_HEAD, 0); + error = got_ref_open(&head_ref, repo, worktree ? + got_worktree_get_head_ref_name(worktree) : GOT_REF_HEAD, 0); if (error != NULL) goto done; error = got_ref_resolve(&commit_id, repo, head_ref); blob - 99c464bbb1c0922bc325ee00100e39b70f857f7f blob + 9618b61537be4967b0ef86f1793eb3479d5a0fb8 --- tog/tog.c +++ tog/tog.c @@ -4438,7 +4438,8 @@ cmd_blame(int argc, char *argv[]) if (commit_id_str == NULL) { struct got_reference *head_ref; - error = got_ref_open(&head_ref, repo, GOT_REF_HEAD, 0); + error = got_ref_open(&head_ref, repo, worktree ? + got_worktree_get_head_ref_name(worktree) : GOT_REF_HEAD, 0); if (error != NULL) goto done; error = got_ref_resolve(&commit_id, repo, head_ref);