Re: [PATCH 1/3] Make test using invalid commit with -C more strict

2013-08-25 Thread Junio C Hamano
Jonathan Nieder jrnie...@gmail.com writes:

 Kacper Kornet wrote:

 In the test 'using invalid commit with -C' git-commit would have failed
 even if the -C option  had been given the correct commit, as there was
 nothing to commit.

 Good catch.

 [...]
 --- a/t/t7501-commit.sh
 +++ b/t/t7501-commit.sh
 @@ -53,7 +53,10 @@ test_expect_success PERL 'can use paths with 
 --interactive' '
  '
  
  test_expect_success 'using invalid commit with -C' '
 -test_must_fail git commit -C bogus
 +echo bong file 
 +git add file 
 +test_must_fail git commit -C bogus 
 +git reset

 I guess to be pedantic this should say

   echo bong file 
   git add file 
   test_when_finished git reset --hard 
   test_must_fail git commit -C bogus

 to avoid interfering with later tests even when this one fails and
 the  prevents the 'git reset' from being executed.

Makes sense.

Also it would be much simpler to say git commit --allow-empty.
--
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


Re: [PATCH 1/3] Make test using invalid commit with -C more strict

2013-08-25 Thread Jonathan Nieder
Junio C Hamano wrote:
 Kacper Kornet wrote:

 In the test 'using invalid commit with -C' git-commit would have failed
 even if the -C option  had been given the correct commit, as there was
 nothing to commit.
[...]
 Also it would be much simpler to say git commit --allow-empty.

Sounds good. ;-)

Thanks,
Jonathan
--
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


Re: [PATCH 1/3] Make test using invalid commit with -C more strict

2013-08-24 Thread Jonathan Nieder
Kacper Kornet wrote:

 In the test 'using invalid commit with -C' git-commit would have failed
 even if the -C option  had been given the correct commit, as there was
 nothing to commit.

Good catch.

[...]
 --- a/t/t7501-commit.sh
 +++ b/t/t7501-commit.sh
 @@ -53,7 +53,10 @@ test_expect_success PERL 'can use paths with 
 --interactive' '
  '
  
  test_expect_success 'using invalid commit with -C' '
 - test_must_fail git commit -C bogus
 + echo bong file 
 + git add file 
 + test_must_fail git commit -C bogus 
 + git reset

I guess to be pedantic this should say

echo bong file 
git add file 
test_when_finished git reset --hard 
test_must_fail git commit -C bogus

to avoid interfering with later tests even when this one fails and
the  prevents the 'git reset' from being executed.

With or without that change,
Reviewed-by: Jonathan Nieder jrnie...@gmail.com
--
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