From: Shawn Pearce <spearce@spearce.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: [PATCH] Move deny_non_fast_forwards handling completely into receive-pack.
Date: Mon, 30 Oct 2006 17:35:18 -0500 [thread overview]
Message-ID: <20061030223518.GF5775@spearce.org> (raw)
The 'receive.denynonfastforwards' option has nothing to do with
the repository format version. Since receive-pack already uses
git_config to initialize itself before executing any updates we
can use the normal configuration strategy and isolate the receive
specific variables away from the core variables.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
cache.h | 1 -
environment.c | 1 -
receive-pack.c | 16 +++++++++++++++-
setup.c | 2 --
4 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/cache.h b/cache.h
index a360528..e997a85 100644
--- a/cache.h
+++ b/cache.h
@@ -189,7 +189,6 @@ extern int prefer_symlink_refs;
extern int log_all_ref_updates;
extern int warn_ambiguous_refs;
extern int shared_repository;
-extern int deny_non_fast_forwards;
extern const char *apply_default_whitespace;
extern int zlib_compression_level;
diff --git a/environment.c b/environment.c
index 63b1d15..84d870c 100644
--- a/environment.c
+++ b/environment.c
@@ -20,7 +20,6 @@ int warn_ambiguous_refs = 1;
int repository_format_version;
char git_commit_encoding[MAX_ENCODING_LENGTH] = "utf-8";
int shared_repository = PERM_UMASK;
-int deny_non_fast_forwards = 0;
const char *apply_default_whitespace;
int zlib_compression_level = Z_DEFAULT_COMPRESSION;
int pager_in_use;
diff --git a/receive-pack.c b/receive-pack.c
index f6f1729..e966148 100644
--- a/receive-pack.c
+++ b/receive-pack.c
@@ -12,12 +12,26 @@ static const char *keep_packer[] = {
"index-pack", "--stdin", "--fix-thin", NULL
};
+static int deny_non_fast_forwards = 0;
static int report_status;
static int keep_pack;
static char capabilities[] = "report-status keep-pack";
static int capabilities_sent;
+static int receive_pack_config(const char *var, const char *value)
+{
+ git_default_config(var, value);
+
+ if (strcmp(var, "receive.denynonfastforwards") == 0)
+ {
+ deny_non_fast_forwards = git_config_bool(var, value);
+ return 0;
+ }
+
+ return 0;
+}
+
static int show_ref(const char *path, const unsigned char *sha1, int flag, void *cb_data)
{
if (capabilities_sent)
@@ -290,7 +304,7 @@ int main(int argc, char **argv)
die("'%s': unable to chdir or not a git archive", dir);
setup_ident();
- git_config(git_default_config);
+ git_config(receive_pack_config);
write_head_info();
diff --git a/setup.c b/setup.c
index 9a46a58..2afdba4 100644
--- a/setup.c
+++ b/setup.c
@@ -244,8 +244,6 @@ int check_repository_format_version(cons
repository_format_version = git_config_int(var, value);
else if (strcmp(var, "core.sharedrepository") == 0)
shared_repository = git_config_perm(var, value);
- else if (strcmp(var, "receive.denynonfastforwards") == 0)
- deny_non_fast_forwards = git_config_bool(var, value);
return 0;
}
--
1.4.3.3.g7d63
next reply other threads:[~2006-10-30 22:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-30 22:35 Shawn Pearce [this message]
2006-10-30 23:06 ` [PATCH] Move deny_non_fast_forwards handling completely into receive-pack Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061030223518.GF5775@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox