Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

git-utils crashes when opening a repository using index version 4 #70

Open
niw opened this issue Mar 21, 2016 · 9 comments
Open

git-utils crashes when opening a repository using index version 4 #70

niw opened this issue Mar 21, 2016 · 9 comments

Comments

@niw
Copy link
Contributor

niw commented Mar 21, 2016

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:

  1. Create a git repository and commit a file.
  2. Run git update-index --index-version=4 to update index version to 4.
  3. Run git.open("path-to-git") on node

Expected behavior:
Open git repository

Actual behavior:
Crash

@Scalahansolo
Copy link

+1 I would like to see this get some traction as this issue makes it hard to use Atom on any such repo.

@niw
Copy link
Contributor Author

niw commented Jun 25, 2016

I think it's better to hold this until libgit2/libgit2#3837 gets merged, which is a real fix for this issue.

@winstliu
Copy link
Contributor

Above PR has been merged.

@winstliu winstliu added the bug label Aug 18, 2016
@xcv58
Copy link

xcv58 commented Sep 2, 2016

Any update? The libgit2 already released new version to fix this.

@niw
Copy link
Contributor Author

niw commented Sep 3, 2016

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.

@niw
Copy link
Contributor Author

niw commented Sep 3, 2016

Just in case I updated #71 to use 0.24.1, which is their latest release (but that doesn't include libgit2/libgit2#3837)

@niw
Copy link
Contributor Author

niw commented Oct 29, 2016

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.

@damieng
Copy link
Contributor

damieng commented Nov 22, 2016

Updated to 0.24.3 which stops the crashing but effectively disables git integration when using with a clone that has a v4 index.

@niw
Copy link
Contributor Author

niw commented Nov 24, 2016

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants