Re: [PATCH] Add a test for git-add --ignore-errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Alex Riesen <raa.lkml@xxxxxxxxx>
---
Junio C Hamano, Tue, May 13, 2008 05:48:22 +0200:
> Alex Riesen <raa.lkml@xxxxxxxxx> writes:
> > +test_expect_success 'git add --ignore-errors' '
> > +	git reset --hard &&
> > +	date >foo1 &&
> > +	date >foo2 &&
> > +	chmod 0 foo2 &&
> > +	git add --verbose --ignore-errors .
> > +	git ls-files |grep foo1
> > +'
> > +
> >  test_done
> 
> I like the fact that you added --ignore-errors and made it still error out
> when it cannot read some files.  Shouldn't we be testing it here with
> "must-fail"?

Yes. Would you mind replacing that patch with this one?

 t/t3700-add.sh |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index 287e058..17ab05a 100755
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
@@ -179,4 +179,13 @@ test_expect_success 'git add --refresh' '
 	test -z "`git diff-index HEAD -- foo`"
 '
 
+test_expect_success 'git add --ignore-errors' '
+	git reset --hard &&
+	date >foo1 &&
+	date >foo2 &&
+	chmod 0 foo2 &&
+	test_must_fail git add --verbose --ignore-errors . &&
+	git ls-files |grep foo1
+'
+
 test_done
-- 
1.5.5.1.206.g7103c

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

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux