summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-02-10 22:20:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-02-10 22:20:05 (GMT)
commitd0a1cbccab54d828be2d83acc73f38c162962966 (patch)
tree474f89e894ad4f8d6e47f5e27d1f08e102a4cd9f /setup.c
parentff4ea6004fb48146330d663d64a71e7774f059f9 (diff)
parent618244e160cb0777bc8d41055f7de0192b10ea0f (diff)
downloadgit-d0a1cbccab54d828be2d83acc73f38c162962966.zip
git-d0a1cbccab54d828be2d83acc73f38c162962966.tar.gz
git-d0a1cbccab54d828be2d83acc73f38c162962966.tar.bz2
Merge branch 'nd/do-not-move-worktree-manually'
"git worktree" had a broken code that attempted to auto-fix possible inconsistency that results from end-users moving a worktree to different places without telling Git (the original repository needs to maintain backpointers to its worktrees, but "mv" run by end-users who are not familiar with that fact will obviously not adjust them), which actually made things worse when triggered. * nd/do-not-move-worktree-manually: worktree: stop supporting moving worktrees manually worktree.c: fix indentation
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/setup.c b/setup.c
index 2c4b22c..0deb022 100644
--- a/setup.c
+++ b/setup.c
@@ -451,17 +451,6 @@ static int check_repository_format_gently(const char *gitdir, int *nongit_ok)
return ret;
}
-static void update_linked_gitdir(const char *gitfile, const char *gitdir)
-{
- struct strbuf path = STRBUF_INIT;
- struct stat st;
-
- strbuf_addf(&path, "%s/gitdir", gitdir);
- if (stat(path.buf, &st) || st.st_mtime + 24 * 3600 < time(NULL))
- write_file(path.buf, "%s", gitfile);
- strbuf_release(&path);
-}
-
/*
* Try to read the location of the git directory from the .git file,
* return path to git directory if found.
@@ -531,7 +520,6 @@ const char *read_gitfile_gently(const char *path, int *return_error_code)
error_code = READ_GITFILE_ERR_NOT_A_REPO;
goto cleanup_return;
}
- update_linked_gitdir(path, dir);
path = real_path(dir);
cleanup_return: