@matheusbsbs / matheus-bagliano / commits / 655e8d9c92
Fork 0

do not pass "git -c foo=bar" params to transport helpers

Like $GIT_CONFIG, $GIT_CONFIG_PARAMETERS needs to be suppressed by "git push" and its cousins when running local transport helpers to imitate remote transport well. Noticed-by: Jeff King <peff@peff.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Nieder committed Aug 24, 2010 at 01:41 UTC 655e8d9c92121b1d84fda91b73c4a0daa638cbf8
3 files changed +25 -1
cache.h
+1 -1
@@ -398,7 +398,7 @@ static inline enum object_type object_type(unsigned int mode)
398 * environment creation or simple walk of the list.
399 * The number of non-NULL entries is available as a macro.
400 */
401 -#define LOCAL_REPO_ENV_SIZE 8
401 +#define LOCAL_REPO_ENV_SIZE 9
402 extern const char *const local_repo_env[LOCAL_REPO_ENV_SIZE + 1];
403
404 extern int is_bare_repository_cfg;
environment.c
+1
@@ -72,6 +72,7 @@ static char *git_object_dir, *git_index_file, *git_refs_dir, *git_graft_file;
72 const char * const local_repo_env[LOCAL_REPO_ENV_SIZE + 1] = {
73 ALTERNATE_DB_ENVIRONMENT,
74 CONFIG_ENVIRONMENT,
75 + CONFIG_DATA_ENVIRONMENT,
76 DB_ENVIRONMENT,
77 GIT_DIR_ENVIRONMENT,
78 GIT_WORK_TREE_ENVIRONMENT,
t/t5400-send-pack.sh
+23
@@ -94,6 +94,29 @@ test_expect_success 'refuse deleting push with denyDeletes' '
94 test_must_fail git send-pack ./victim :extra master
95 '
96
97 +test_expect_success 'cannot override denyDeletes with git -c send-pack' '
98 + (
99 + cd victim &&
100 + test_might_fail git branch -D extra &&
101 + git config receive.denyDeletes true &&
102 + git branch extra master
103 + ) &&
104 + test_must_fail git -c receive.denyDeletes=false \
105 + send-pack ./victim :extra master
106 +'
107 +
108 +test_expect_success 'override denyDeletes with git -c receive-pack' '
109 + (
110 + cd victim &&
111 + test_might_fail git branch -D extra &&
112 + git config receive.denyDeletes true &&
113 + git branch extra master
114 + ) &&
115 + git send-pack \
116 + --receive-pack="git -c receive.denyDeletes=false receive-pack" \
117 + ./victim :extra master
118 +'
119 +
120 test_expect_success 'denyNonFastforwards trumps --force' '
121 (
122 cd victim &&