]> source.dussan.org Git - jgit.git/commit
Fix GarbageCollection not to pack HEAD 25/23925/1
authorChristian Halstrick <christian.halstrick@sap.com>
Wed, 26 Mar 2014 14:27:48 +0000 (15:27 +0100)
committerChristian Halstrick <christian.halstrick@sap.com>
Wed, 26 Mar 2014 14:27:48 +0000 (15:27 +0100)
commit16436ef6d98e564d60edd1bee5026aeda0def1e6
tree0597225b815ddf5d787b1d1e0d01414b5d96573d
parent27473d8e66bda58c51eca6f474885bd893e79f07
Fix GarbageCollection not to pack HEAD

When working on a non-bare repository with a detached HEAD jgit's GC was
packing the ref named "HEAD" into the packed-refs file and deleted the
loose ref (the file .git/HEAD!). This made the repo unusable for native
git. This is fixed by telling jgit to only pack refs starting from
"refs/"

Change-Id: I50018aa006f18b244d2cae2ff78b5ffe1b821d63
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPackRefsTest.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java