Allow git commit --interactive with paths
Make git commit --interactive feel more like git add --interactive by allowing the user to restrict the list of files they have to deal with. A test in t7501 used to ensure that this is not allowed; no need for that anymore. Signed-off-by: Conrad Irwin <conrad.irwin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Conrad Irwin committed
May 6, 2011 at 23:00 UTC
e41fcfe955cb8080bf8f0e16352d3131d1f01ac8
2 files changed
+3
-4
builtin/commit.c
-2
@@ -1084,8 +1084,6 @@ static int parse_and_validate_options(int argc, const char *argv[],
1084
1085
if (all && argc > 0)
1086
die(_("Paths with -a does not make sense."));
1087
- else if (interactive && argc > 0)
1088
- die(_("Paths with --interactive does not make sense."));
1087
1088
if (null_termination && status_format == STATUS_FORMAT_LONG)
1089
status_format = STATUS_FORMAT_PORCELAIN;
t/t7501-commit.sh
+3
-2
@@ -41,11 +41,12 @@ test_expect_success \
41
"echo King of the bongo >file &&
42
test_must_fail git commit -m foo -a file"
43
44
-test_expect_success PERL 'cannot use paths with --interactive' '
44
+test_expect_success PERL 'can use paths with --interactive' '
45
echo bong-o-bong >file &&
46
# 2: update, 1:st path, that is all, 7: quit
47
( echo 2; echo 1; echo; echo 7 ) |
48
- test_must_fail git commit -m foo --interactive file
48
+ git commit -m foo --interactive file &&
49
+ git reset --hard HEAD^
50
'
51
52
test_expect_success \