Git fork

Merge branch 'ml/reflog-write-committer-info-fix'

"git reflog write" did not honor the configured user.name/email
which has been corrected.

* ml/reflog-write-committer-info-fix:
builtin/reflog: respect user config in "write" subcommand

+38
+2
builtin/reflog.c
··· 418 418 const char *ref, *message; 419 419 int ret; 420 420 421 + repo_config(repo, git_ident_config, NULL); 422 + 421 423 argc = parse_options(argc, argv, prefix, options, reflog_write_usage, 0); 422 424 if (argc != 4) 423 425 usage_with_options(reflog_write_usage, options);
+36
t/t1421-reflog-write.sh
··· 108 108 ) 109 109 ' 110 110 111 + test_expect_success 'uses user.name and user.email config' ' 112 + test_when_finished "rm -rf repo" && 113 + git init repo && 114 + ( 115 + cd repo && 116 + test_commit initial && 117 + COMMIT_OID=$(git rev-parse HEAD) && 118 + 119 + sane_unset GIT_COMMITTER_NAME && 120 + sane_unset GIT_COMMITTER_EMAIL && 121 + git config --local user.name "Author" && 122 + git config --local user.email "a@uth.or" && 123 + git reflog write refs/heads/something $ZERO_OID $COMMIT_OID first && 124 + test_reflog_matches . refs/heads/something <<-EOF 125 + $ZERO_OID $COMMIT_OID Author <a@uth.or> $GIT_COMMITTER_DATE first 126 + EOF 127 + ) 128 + ' 129 + 130 + test_expect_success 'environment variables take precedence over config' ' 131 + test_when_finished "rm -rf repo" && 132 + git init repo && 133 + ( 134 + cd repo && 135 + test_commit initial && 136 + COMMIT_OID=$(git rev-parse HEAD) && 137 + 138 + git config --local user.name "Author" && 139 + git config --local user.email "a@uth.or" && 140 + git reflog write refs/heads/something $ZERO_OID $COMMIT_OID first && 141 + test_reflog_matches . refs/heads/something <<-EOF 142 + $ZERO_OID $COMMIT_OID $SIGNATURE first 143 + EOF 144 + ) 145 + ' 146 + 111 147 test_expect_success 'can write to root ref' ' 112 148 test_when_finished "rm -rf repo" && 113 149 git init repo &&