Junio C Hamano <gits...@pobox.com> writes:

> Allen Hubbe <alle...@gmail.com> writes:
>
>> Looking closer at this and the other test cases, they are inconsistent
>> about using ".mailrc", "~/.mailrc", and "$(pwd)/.mailrc".  This would
>> add another one, "$HOME/.mailrc".
>
> In t9001, I see two tests on mailrc:
> ...
> So I do not see any reason to change most of these; except that the
> target of 'echo' should be changed from ~/.mailrc to $HOME/.mailrc.

FYI, I have tentatively queued this on top of your patch.  Please
see "git log master..cf954075" to double check.

Thanks.

-- >8 --

Subject: [PATCH] t9001: write $HOME/, not ~/, to help shells without tilde 
expansion

Even though it is in POSIX, we do not have to use it, only to hurt
shells that may lack the support.

The .mailrc test tries to define an alias in .mailrc in the home
directory by shell redirection, and then tries to see ~/.mailrc in
config is tilde-expanded by Git without help from shell.  So the
creation should become $HOME/ to be portable for shells that may
lack tilde expansion but the reference should be done as "~/.mailrc".

The sendmail one refers to the file from the configuration with full
path, so it does not need to know that $HOME during the test run is
set to the current "trash" directory.

Signed-off-by: Junio C Hamano <gits...@pobox.com>
---
 t/t9001-send-email.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index b04d263..c5c6867 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -1537,7 +1537,7 @@ test_expect_success $PREREQ 
'sendemail.aliasfiletype=mailrc' '
 
 test_expect_success $PREREQ 'sendemail.aliasfile=~/.mailrc' '
        clean_fake_sendmail &&
-       echo "alias sbd  some...@example.org" >~/.mailrc &&
+       echo "alias sbd  some...@example.org" >"$HOME/.mailrc" &&
        git config --replace-all sendemail.aliasesfile "~/.mailrc" &&
        git config sendemail.aliasfiletype mailrc &&
        git send-email \
@@ -1552,7 +1552,7 @@ test_expect_success $PREREQ 
'sendemail.aliasfile=~/.mailrc' '
 test_expect_success $PREREQ 'sendemail.aliasfiletype=sendmail' '
        clean_fake_sendmail && rm -fr outdir &&
        git format-patch -1 -o outdir &&
-       cat >>~/.tmp-email-aliases <<-\EOF &&
+       cat >>./.tmp-email-aliases" <<-\EOF &&
        alice: Alice W Land <a...@example.com>
        bob: Robert Bobbyton <b...@example.com>
        # this is a comment
-- 
2.4.1-455-ga49e496

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to