[PATCH] git-commit: Add tests for invalid usage of -a/--interactive with paths

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

 



git-commit was/is broken in that it accepts paths together with -a or
--interactive, which it shouldn't. There tests check those usage errors.

Signed-off-by: Björn Steinbrink <B.Steinbrink@xxxxxx>
---
> [Stalled]
> 
> * bs/maint-commit-options (Mon Nov 5 20:36:33 2007 +0100) 1 commit
>  - git-commit.sh: Fix usage checks regarding paths given when they do
>    not make sense
> 
> This is meant to go to 'maint' but needs test script to exhibit
> the existing breakage and demonstrate the fix.
> 
> The test will help catching future regression even after we
> replace git-commit with Kristian's rewrite in C.

Sorry, didn't take your comment to that patch as a request to provide
tests. Anyway, here they are :-) I hope I got the commit message/comment
formatting right this time.

diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index 4dc35bd..9dba104 100644
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -34,6 +34,16 @@ test_expect_failure \
 	"git-commit -C HEAD -m illegal"
 
 test_expect_failure \
+	"using paths with -a" \
+	"echo King of the bongo >file &&
+	git-commit -m foo -a file"
+
+test_expect_failure \
+	"using paths with --interactive" \
+	"echo bong-o-bong >file &&
+	echo 7 | git-commit -m foo --interactive file"
+
+test_expect_failure \
 	"using invalid commit with -C" \
 	"git-commit -C bogus"
 
-
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