sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
803 stars 39 forks source link

Git integration breaks with `git update-index --split-index` #6453

Open DannyBen opened 4 weeks ago

DannyBen commented 4 weeks ago

Description of the bug

When using sublime text on a repository that has split index (git update-index --split-index), git integration breaks in the following ways:

  1. Sidebar shows all items as untracked
  2. The file editing area, no longer shows new/modified lines compared to their git state. Note that changes are highlighted while the file is open.

Screenshots

Sidebar

image

File change markers are gone

out

Steps to reproduce

  1. Start Sublime
  2. Create a project with at least one file and one subfolder (optional, but shows more issues)
  3. Initialize a git repository in the folder, and commit everything
  4. Up to this point, sublime should show git markers properly.
  5. Run git update-inedx --split-index
  6. Change or add another file, and commit to the git repository (to update the index).
  7. Restart sublime
  8. At this point, sublime sidebar markers should already be disconnected from reality
  9. Open one of the project files in sublime, make a change.
  10. Close the file, and reopen it - notice that no changes are highlighted.

Expected behavior

Expecting to have sublime git integration behave the same when --split-index was used on the repository.

Actual behavior

Sublime does not recognize the git index properly.

Sublime Text build number

4180

Operating system & version

Windows 11

(Linux) Desktop environment and/or window manager

No response

Additional information

No response

OpenGL context information

No response

deathaxe commented 4 weeks ago

According to "Licenses & Attribution" Sublime Text uses libgit2.

If that's the case, resolving this issue depends on https://github.com/libgit2/libgit2/issues/6132.

BenjaminSchaaf commented 3 weeks ago

@deathaxe libgit2 is used for very little, primarily the diff implementation. We don't use libgit2 for any of its git reading functionality. That issue is unrelated.