| 1089 | } |
| 1090 | |
| 1091 | static void set_git_dir(struct repository *repo, const char *path, int make_realpath) |
| 1092 | { |
| 1093 | struct strbuf realpath = STRBUF_INIT; |
| 1094 | |
| 1095 | if (make_realpath) { |
| 1096 | strbuf_realpath(&realpath, path, 1); |
| 1097 | path = realpath.buf; |
| 1098 | } |
| 1099 | |
| 1100 | set_git_dir_1(repo, path); |
| 1101 | if (!is_absolute_path(path)) |
| 1102 | chdir_notify_register(NULL, update_relative_gitdir, repo); |
| 1103 | |
| 1104 | strbuf_release(&realpath); |
| 1105 | } |
| 1106 | |
| 1107 | static const char *setup_explicit_git_dir(struct repository *repo, |
| 1108 | const char *gitdirenv, |
no test coverage detected