Skip to content

Commit

Permalink
Merge branch 'am/pathspec-from-file'
Browse files Browse the repository at this point in the history
An earlier series to teach "--pathspec-from-file" to "git commit"
forgot to make the option incompatible with "--all", which has been
corrected.

* am/pathspec-from-file:
  commit: forbid --pathspec-from-file --all
  • Loading branch information
gitster committed Dec 25, 2019
2 parents 12029dc + 509efef commit ff0cb70
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions builtin/commit.c
Expand Up @@ -347,6 +347,9 @@ static const char *prepare_index(int argc, const char **argv, const char *prefix
if (interactive)
die(_("--pathspec-from-file is incompatible with --interactive/--patch"));

if (all)
die(_("--pathspec-from-file with -a does not make sense"));

if (pathspec.nr)
die(_("--pathspec-from-file is incompatible with pathspec arguments"));

Expand Down
6 changes: 6 additions & 0 deletions t/t7526-commit-pathspec-file.sh
Expand Up @@ -127,4 +127,10 @@ test_expect_success 'only touches what was listed' '
verify_expect
'

test_expect_success '--pathspec-from-file and --all cannot be used together' '
restore_checkpoint &&
test_must_fail git commit --pathspec-from-file=- --all -m "Commit" 2>err &&
test_i18ngrep "[-]-pathspec-from-file with -a does not make sense" err
'

test_done

0 comments on commit ff0cb70

Please sign in to comment.