forked from mirrors/jj
repo: fix crash on upgrade of repo backed by external Git repo
If the repo is backed by Git repo that's not inside `.jj/`, then there's no `.jj/git/` directory to move into `.jj/store/`.
This commit is contained in:
parent
97b48635f6
commit
6722a79e27
1 changed files with 3 additions and 1 deletions
|
@ -399,7 +399,9 @@ impl RepoLoader {
|
|||
let git_backend_path_str = contents[5..].to_string();
|
||||
fs::remove_file(&store_path).unwrap();
|
||||
fs::create_dir(&store_path).unwrap();
|
||||
if repo_path.join("git").is_dir() {
|
||||
fs::rename(repo_path.join("git"), store_path.join("git")).unwrap();
|
||||
}
|
||||
fs::write(store_path.join("git_target"), &git_backend_path_str).unwrap();
|
||||
println!("Done. .jj/git is now .jj/store/git");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue