obsidian-git icon indicating copy to clipboard operation
obsidian-git copied to clipboard

fix(mobile): resolve push hanging

Open ras0q opened this issue 1 year ago • 6 comments

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.

ras0q avatar Jan 29 '24 23:01 ras0q

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.

Vinzent03 avatar Jan 31 '24 22:01 Vinzent03

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

ras0q avatar Feb 01 '24 15:02 ras0q

Here is my brief benchmark! https://github.com/ras0q/isomorphic-git-walk-test

ras0q avatar Feb 01 '24 15:02 ras0q

@denolehov @Vinzent03 could you review this PR? Thanks!

ras0q avatar Feb 13 '24 08:02 ras0q

Adding #653 as another instance.

I’m experiencing this too

antgiant avatar Feb 21 '24 22:02 antgiant

When digging the code of TREE() it uses `resolveRef()', just like you do now manually. I don't see what this pr actually changes.

Vinzent03 avatar Feb 21 '24 22:02 Vinzent03