]> source.dussan.org Git - jgit.git/commit
Add worktrees read support 00/1194900/7
authorJanne Valkealahti <janne.valkealahti@broadcom.com>
Thu, 4 Jul 2024 06:44:49 +0000 (07:44 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Sun, 14 Jul 2024 21:39:07 +0000 (23:39 +0200)
commitf9beeb3b33e438fa3a10eb3871206573ae986abb
tree05d5d457e28eaba705c8a9041968247740c3cc18
parent2a19bfc7319a55ba00dbdaf469481f0ddee8b4f5
Add worktrees read support

Based on deritative work done in Andre's work in [1].

This change focuses on adding support for reading the repository
state when branches are checked out using git's worktrees.

I've refactored original work by removing all unrelevant
changes which were mostly around refactoring to extract
i.e. constants which mostly created noise for a review.

I've tried to address original review comments:
- Not adding non-behavioral changes
- "HEAD" should get resolved from gitDir
- Reftable recently landed in cgit 2.45,
  see https://github.com/git/git/blob/master/Documentation/RelNotes/2.45.0.txt#L8
  We can add worktree support for reftable in a later change.
- Some new tests to read from a linked worktree which
  is created manually as there's no write support.

[1] https://git.eclipse.org/r/c/jgit/jgit/+/163940/18

Change-Id: Id077d58fb6c09ecb090eb09d5dbc7edc351a581d
29 files changed:
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Config.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/EolRepositoryTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/LinkedWorktreeTest.java [new file with mode: 0644]
org.eclipse.jgit.test/tst/org/eclipse/jgit/attributes/AttributesHandlerTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/BatchRefUpdateTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPackRefsTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcReflogTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ReflogReaderTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ReflogWriterTest.java
org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleAddCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/SubmoduleUpdateCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableDatabase.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GcLog.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/InfoAttributesNode.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ReflogReaderImpl.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportGitSsh.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportLocal.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java
org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java