commit cae49de0a80da9ab02ce855debdd56fb0be36400 from: Stefan Sperling via: Thomas Adam date: Fri Jul 22 21:06:45 2022 UTC make 'got histedit' fetch author info from Git configuration as a fallback commit - 8db00f97570360c732c5c8b9ab0f0415e74184c0 commit + cae49de0a80da9ab02ce855debdd56fb0be36400 blob - f743d74c16b90ed6ccc26ca725759193a06afcdb blob + 535760c6be3a2ad3aee954af2ae3c1f38620753a --- got/got.c +++ got/got.c @@ -11260,7 +11260,7 @@ cmd_histedit(int argc, char *argv[]) struct got_worktree *worktree = NULL; struct got_fileindex *fileindex = NULL; struct got_repository *repo = NULL; - char *cwd = NULL, *committer = NULL; + char *cwd = NULL, *committer = NULL, *gitconfig_path = NULL; struct got_reference *branch = NULL; struct got_reference *tmp_branch = NULL; struct got_object_id *resume_commit_id = NULL; @@ -11435,8 +11435,11 @@ cmd_histedit(int argc, char *argv[]) goto done; /* nothing else to do */ } + error = get_gitconfig_path(&gitconfig_path); + if (error) + goto done; error = got_repo_open(&repo, got_worktree_get_repo_path(worktree), - NULL, pack_fds); + gitconfig_path, pack_fds); if (error != NULL) goto done; @@ -11795,6 +11798,7 @@ cmd_histedit(int argc, char *argv[]) done: free(cwd); free(committer); + free(gitconfig_path); got_object_id_queue_free(&commits); histedit_free_list(&histedit_cmds); free(head_commit_id);