} else {
unable_to_lock_message(ref_file.buf, myerr, err);
if (myerr == EEXIST) {
- if (repo_ignore_case(the_repository) &&
- if (ignore_case &&
++ if (repo_ignore_case(refs->base.repo) &&
transaction_has_case_conflicting_update(transaction, update)) {
/*
* In case-insensitive filesystems, ensure that conflicts within a
* conflicts between 'foo' and 'Foo/bar'. So let's lowercase
* the refname.
*/
- if (repo_ignore_case(the_repository)) {
- if (ignore_case) {
++ if (repo_ignore_case(refs->base.repo)) {
struct strbuf lower = STRBUF_INIT;
strbuf_addstr(&lower, refname);
if (!exist_ok && !stat(real_git_dir, &st))
die(_("%s already exists"), real_git_dir);
- set_git_dir(repo, real_git_dir, 1);
+ apply_and_export_relative_gitdir(repo, real_git_dir, 1);
git_dir = repo_get_git_dir(repo);
- separate_git_dir(git_dir, original_git_dir);
+ separate_git_dir(repo, git_dir, original_git_dir);
- }
- else {
- set_git_dir(repo, git_dir, 1);
+ } else {
+ apply_and_export_relative_gitdir(repo, git_dir, 1);
git_dir = repo_get_git_dir(repo);
}
- startup_info->have_repository = 1;
+
+ if (worktree)
+ set_git_work_tree(repo, worktree);
/*
* Check to see if the repository version is right.