summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4a4e6fd)
raw | patch | inline | side by side (parent: 4a4e6fd)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Tue, 15 Nov 2005 18:24:19 +0000 (19:24 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 15 Nov 2005 19:42:29 +0000 (11:42 -0800) |
This allows you to force git to avoid symlinks for refs. Just add
something like
[core]
symrefsonly = true
to .git/config.
DonĀ“t forget to "git checkout your_branch", or it does not do anything...
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
something like
[core]
symrefsonly = true
to .git/config.
DonĀ“t forget to "git checkout your_branch", or it does not do anything...
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
cache.h | patch | blob | history | |
config.c | patch | blob | history | |
environment.c | patch | blob | history | |
refs.c | patch | blob | history | |
symbolic-ref.c | patch | blob | history |
index 677c6acc350155d606e2ba05a9bbf5eb28637a31..9a6bfb96d9d0f4e8316dbbe60469988cf48f197b 100644 (file)
--- a/cache.h
+++ b/cache.h
extern void rollback_index_file(struct cache_file *);
extern int trust_executable_bit;
+extern int only_use_symrefs;
#define MTIME_CHANGED 0x0001
#define CTIME_CHANGED 0x0002
diff --git a/config.c b/config.c
index e89bab26c99f95e6bb7d3346343ab0c623843c42..bd35138daec12366193bf6e2b95399ef8287d205 100644 (file)
--- a/config.c
+++ b/config.c
return 0;
}
+ if (!strcmp(var, "core.symrefsonly")) {
+ only_use_symrefs = git_config_bool(var, value);
+ return 0;
+ }
+
if (!strcmp(var, "user.name")) {
strncpy(git_default_name, value, sizeof(git_default_name));
return 0;
diff --git a/environment.c b/environment.c
index 1dc7af56cf93e46c456eaa13f8f8150258abe43c..b5026f1265b771bc3f9906507b015fbd1d68f8fb 100644 (file)
--- a/environment.c
+++ b/environment.c
char git_default_email[MAX_GITNAME];
char git_default_name[MAX_GITNAME];
int trust_executable_bit = 1;
+int only_use_symrefs = 0;
static char *git_dir, *git_object_dir, *git_index_file, *git_refs_dir,
*git_graft_file;
index a52b038eefdf22fce20d1a81180c97def0613cdb..f324be50325d1ba765fbbb823937bf68ef91c0aa 100644 (file)
--- a/refs.c
+++ b/refs.c
int fd, len, written;
#if USE_SYMLINK_HEAD
- unlink(git_HEAD);
- if (!symlink(refs_heads_master, git_HEAD))
- return 0;
- fprintf(stderr, "no symlink - falling back to symbolic ref\n");
+ if (!only_use_symrefs) {
+ unlink(git_HEAD);
+ if (!symlink(refs_heads_master, git_HEAD))
+ return 0;
+ fprintf(stderr, "no symlink - falling back to symbolic ref\n");
+ }
#endif
len = snprintf(ref, sizeof(ref), "ref: %s\n", refs_heads_master);
diff --git a/symbolic-ref.c b/symbolic-ref.c
index a72d7accb18092231c608a6ae7db4a4ce9dc8b73..193c87c174706710b346e58c42a9651dbb5e671f 100644 (file)
--- a/symbolic-ref.c
+++ b/symbolic-ref.c
int main(int argc, const char **argv)
{
setup_git_directory();
+ git_config(git_default_config);
switch (argc) {
case 2:
check_symref(argv[1]);