diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-04-25 16:41:14 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-04-25 16:41:14 +0900 |
commit | b72e90712eb0e802b232ad4c88460d04279c7111 (patch) | |
tree | fa942ba292b5e3dd1091c526700a7d801ef40358 /t | |
parent | Merge branch 'pw/cherry-pick-continue' (diff) | |
parent | difftool: allow running outside Git worktrees with --no-index (diff) | |
download | tgif-b72e90712eb0e802b232ad4c88460d04279c7111.tar.xz |
Merge branch 'js/difftool-no-index'
"git difftool" can now run outside a repository.
* js/difftool-no-index:
difftool: allow running outside Git worktrees with --no-index
parse-options: make OPT_ARGUMENT() more useful
difftool: remove obsolete (and misleading) comment
Diffstat (limited to 't')
-rw-r--r-- | t/helper/test-parse-options.c | 2 | ||||
-rwxr-xr-x | t/t7800-difftool.sh | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/t/helper/test-parse-options.c b/t/helper/test-parse-options.c index cc88fba057..2232b2f79e 100644 --- a/t/helper/test-parse-options.c +++ b/t/helper/test-parse-options.c @@ -132,7 +132,7 @@ int cmd__parse_options(int argc, const char **argv) OPT_NOOP_NOARG(0, "obsolete"), OPT_STRING_LIST(0, "list", &list, "str", "add str to list"), OPT_GROUP("Magic arguments"), - OPT_ARGUMENT("quux", "means --quux"), + OPT_ARGUMENT("quux", NULL, "means --quux"), OPT_NUMBER_CALLBACK(&integer, "set integer to NUM", number_callback), { OPTION_COUNTUP, '+', NULL, &boolean, NULL, "same as -b", diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh index bb9a7f4ff9..480dd0633f 100755 --- a/t/t7800-difftool.sh +++ b/t/t7800-difftool.sh @@ -705,4 +705,14 @@ test_expect_success SYMLINKS 'difftool --dir-diff handles modified symlinks' ' test_cmp expect actual ' +test_expect_success 'outside worktree' ' + echo 1 >1 && + echo 2 >2 && + test_expect_code 1 nongit git \ + -c diff.tool=echo -c difftool.echo.cmd="echo \$LOCAL \$REMOTE" \ + difftool --no-prompt --no-index ../1 ../2 >actual && + echo "../1 ../2" >expect && + test_cmp expect actual +' + test_done |