Skip to content

Commit

Permalink
feat: jujustu support
Browse files Browse the repository at this point in the history
If the .git directory can't be opened (usually because the `.git` directory is missing) it attempts to find the git repository in the location used by Jujutsu (i.e. `.jj/repo/store/git`). If the Jujutsu git directory doesn't exist, then the origin error is propogated.
  • Loading branch information
kemitix authored and Paul Campbell committed Oct 23, 2024
1 parent 99b78b5 commit eb3a09d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion git-cliff-core/src/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,15 @@ impl Repository {
/// Initializes (opens) the repository.
pub fn init(path: PathBuf) -> Result<Self> {
if path.exists() {
let inner = GitRepository::open(&path)?;
let inner = GitRepository::open(&path).or_else(|err| {
let jujutsu_path =
path.join(".jj").join("repo").join("store").join("git");
if jujutsu_path.exists() {
GitRepository::open(&jujutsu_path)
} else {
Err(err)
}
})?;
let changed_files_cache_path = inner
.path()
.join(env!("CARGO_PKG_NAME"))
Expand Down

0 comments on commit eb3a09d

Please sign in to comment.