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
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;
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;
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);
int main(int argc, const char **argv)
{
setup_git_directory();
+ git_config(git_default_config);
switch (argc) {
case 2:
check_symref(argv[1]);