obsidian-git
obsidian-git copied to clipboard
fix(mobile): resolve push hanging
ref: https://github.com/denolehov/obsidian-git/issues/609 https://github.com/denolehov/obsidian-git/issues/574
async push() for mobile is implemented using this.branchInfo(), but this branch info should be converted to latest commit hash.
Did you encounter one of these two branches being null? I'm pretty sure the ref for a Tree can also just be the branch name.
I don't encounter that and using both the branch name and the commit hash can be the ref for a tree.
However by using the commit hash, I think git.TREE({ ref }) can be resolved more quickly.
https://github.com/isomorphic-git/isomorphic-git/blob/53310498e9dd84a213197de2d69047ce733580e6/src/managers/GitRefManager.js#L193
Here is my brief benchmark! https://github.com/ras0q/isomorphic-git-walk-test
@denolehov @Vinzent03 could you review this PR? Thanks!
Adding #653 as another instance.
I’m experiencing this too
When digging the code of TREE() it uses `resolveRef()', just like you do now manually. I don't see what this pr actually changes.