summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ff38d1a)
raw | patch | inline | side by side (parent: ff38d1a)
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Mon, 16 Aug 2010 00:36:12 +0000 (10:36 +1000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 16 Aug 2010 02:56:10 +0000 (19:56 -0700) |
As v1.7.2~16^2 (2010-07-14) explains, without this change,
“git --paginate apply” can ignore the repository-local
“[core] pager” configuration.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
“git --paginate apply” can ignore the repository-local
“[core] pager” configuration.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/apply.c | patch | blob | history | |
git.c | patch | blob | history | |
t/t7006-pager.sh | patch | blob | history |
diff --git a/builtin/apply.c b/builtin/apply.c
index 12ef9ea8afb0aa1e554e3ce6c6085e97ff7e7466..f005ba1e8934d4383f6181737a53a388d8b03a61 100644 (file)
--- a/builtin/apply.c
+++ b/builtin/apply.c
return 0;
}
-int cmd_apply(int argc, const char **argv, const char *unused_prefix)
+int cmd_apply(int argc, const char **argv, const char *prefix_)
{
int i;
int errs = 0;
- int is_not_gitdir;
+ int is_not_gitdir = !startup_info->have_repository;
int binary;
int force_apply = 0;
OPT_END()
};
- prefix = setup_git_directory_gently(&is_not_gitdir);
+ prefix = prefix_;
prefix_length = prefix ? strlen(prefix) : 0;
git_config(git_apply_config, NULL);
if (apply_default_whitespace)
index 5a47bfbcbd39b7e6ec5b2bbc358f63fb134120c1..38dbe7022e99599a051af84f73685b23248b752f 100644 (file)
--- a/git.c
+++ b/git.c
{ "add", cmd_add, RUN_SETUP | NEED_WORK_TREE },
{ "stage", cmd_add, RUN_SETUP | NEED_WORK_TREE },
{ "annotate", cmd_annotate, RUN_SETUP },
- { "apply", cmd_apply },
+ { "apply", cmd_apply, RUN_SETUP_GENTLY },
{ "archive", cmd_archive },
{ "bisect--helper", cmd_bisect__helper, RUN_SETUP | NEED_WORK_TREE },
{ "blame", cmd_blame, RUN_SETUP },
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh
index bb9533581ebaf57eb2f4904dcd41d13b85e78270..6c86d7035ffa32d75bfd7e93f61299eafb2b3603 100755 (executable)
--- a/t/t7006-pager.sh
+++ b/t/t7006-pager.sh
test_default_pager expect_success 'git -p shortlog'
test_core_pager_subdir expect_success 'git -p shortlog'
+test_core_pager_subdir expect_success test_must_fail \
+ 'git -p apply </dev/null'
+
test_done