diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-11-23 11:23:17 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-11-23 11:23:17 -0800 |
commit | c34a7daad74b0f7b0dc72de131dbb9e919b0ab32 (patch) | |
tree | 1d2770d0c868cc2be228028e4865724cb860e48d /t | |
parent | 6a2b569c2fec49cc213e0218f1251749771044d6 (diff) | |
parent | eb0224c617ba6b4299f2a9f85d6c4b3b5e10abc0 (diff) | |
download | git-c34a7daad74b0f7b0dc72de131dbb9e919b0ab32.tar.gz git-c34a7daad74b0f7b0dc72de131dbb9e919b0ab32.tar.xz |
Merge branch 'jc/setup-cleanup-fix'
"git archive" and "git mailinfo" stopped reading from local
configuration file with a recent update.
* jc/setup-cleanup-fix:
archive: read local configuration
mailinfo: read local configuration
Diffstat (limited to 't')
-rwxr-xr-x | t/t5000-tar-tree.sh | 35 | ||||
-rwxr-xr-x | t/t5100-mailinfo.sh | 13 |
2 files changed, 45 insertions, 3 deletions
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh index 80b238734..830bf2a2f 100755 --- a/t/t5000-tar-tree.sh +++ b/t/t5000-tar-tree.sh @@ -94,6 +94,20 @@ check_tar() { ' } +# run "$@" inside a non-git directory +nongit () { + test -d non-repo || + mkdir non-repo || + return 1 + + ( + GIT_CEILING_DIRECTORIES=$(pwd) && + export GIT_CEILING_DIRECTORIES && + cd non-repo && + "$@" + ) +} + test_expect_success \ 'populate workdir' \ 'mkdir a && @@ -179,6 +193,15 @@ test_expect_success 'git archive --remote' \ 'git archive --remote=. HEAD >b5.tar && test_cmp_bin b.tar b5.tar' +test_expect_success 'git archive --remote with configured remote' ' + git config remote.foo.url . && + ( + cd a && + git archive --remote=foo --output=../b5-nick.tar HEAD + ) && + test_cmp_bin b.tar b5-nick.tar +' + test_expect_success \ 'validate file modification time' \ 'mkdir extract && @@ -197,9 +220,15 @@ test_expect_success 'git archive with --output, override inferred format' ' test_cmp_bin b.tar d4.zip ' -test_expect_success \ - 'git archive --list outside of a git repo' \ - 'GIT_DIR=some/non-existing/directory git archive --list' +test_expect_success 'git archive --list outside of a git repo' ' + nongit git archive --list +' + +test_expect_success 'git archive --remote outside of a git repo' ' + git archive HEAD >expect.tar && + nongit git archive --remote="$PWD" HEAD >actual.tar && + test_cmp_bin expect.tar actual.tar +' test_expect_success 'clients cannot access unreachable commits' ' test_commit unreachable && diff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh index e6b995161..7171f6753 100755 --- a/t/t5100-mailinfo.sh +++ b/t/t5100-mailinfo.sh @@ -158,4 +158,17 @@ test_expect_success 'mailinfo handles rfc2822 comment' ' test_cmp "$DATA/comment.expect" comment/info ' +test_expect_success 'mailinfo with mailinfo.scissors config' ' + test_config mailinfo.scissors true && + ( + mkdir sub && + cd sub && + git mailinfo ../msg0014.sc ../patch0014.sc <../0014 >../info0014.sc + ) && + test_cmp "$DATA/msg0014--scissors" msg0014.sc && + test_cmp "$DATA/patch0014--scissors" patch0014.sc && + test_cmp "$DATA/info0014--scissors" info0014.sc +' + + test_done |