git-utils crashes when opening a repository using index version 4
niw opened this issue · 9 comments
Due to current submodule libgit2
which doesn't support index version 4 and may crash because of tree_iterator
implementation issue, git-utils
may crash when opening such git repository.
A minimum fix is, at least, merge libgit2/libgit2@4fea9cf commit.
A real fix is ask libgit2
to support index version 4 (See https://github.com/libgit2/libgit2/blob/master/src/index.c#L2343-L2345)
Repro steps:
- Create a git repository and commit a file.
- Run
git update-index --index-version=4
to update index version to 4. - Run
git.open("path-to-git")
onnode
Expected behavior:
Open git repository
Actual behavior:
Crash
+1 I would like to see this get some traction as this issue makes it hard to use Atom on any such repo.
I think it's better to hold this until libgit2/libgit2#3837 gets merged, which is a real fix for this issue.
Above PR has been merged.
Any update? The libgit2 already released new version to fix this.
libgit2/libgit2#3837 is merged on libgit2/libgit2 and on its master, however, it's not released yet.
I think it might be better to wait its release, technically we can use its master tho.
Just in case I updated #71 to use 0.24.1, which is their latest release (but that doesn't include libgit2/libgit2#3837)
I updated again #71 to use 0.24.2.
However, seems like any libgit2 0.24.x may not include libgit2/libgit2#3837 that addresses index version 4 issue. So, probably #71 may not a fix for this issue, however, still #71 that upgrades libgit2 to 0.24.x might be useful because it can solve #73 as @tgandrews mentioned.
Updated to 0.24.3 which stops the crashing but effectively disables git integration when using with a clone that has a v4 index.
As I commented before on this thread, libgit2/libgit2#3837 is the real solution for this issue, which is merged in libgit2 master
and available as a part of v0.25.0-rc1
. Thus, once libgit2/libgit2 v0.25.0 is released, then bump the version, then we can solve this issue also atom/atom#11225.