Skip to content

Commit e41fcfe

Browse files
ConradIrwingitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 587ac8c commit e41fcfe

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

builtin/commit.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,8 +1084,6 @@ static int parse_and_validate_options(int argc, const char *argv[],
10841084

10851085
if (all && argc > 0)
10861086
die(_("Paths with -a does not make sense."));
1087-
else if (interactive && argc > 0)
1088-
die(_("Paths with --interactive does not make sense."));
10891087

10901088
if (null_termination && status_format == STATUS_FORMAT_LONG)
10911089
status_format = STATUS_FORMAT_PORCELAIN;

t/t7501-commit.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ test_expect_success \
4141
"echo King of the bongo >file &&
4242
test_must_fail git commit -m foo -a file"
4343

44-
test_expect_success PERL 'cannot use paths with --interactive' '
44+
test_expect_success PERL 'can use paths with --interactive' '
4545
echo bong-o-bong >file &&
4646
# 2: update, 1:st path, that is all, 7: quit
4747
( 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^
4950
'
5051

5152
test_expect_success \

0 commit comments

Comments
 (0)