Browse Source

Create empty GIT_DIR/hooks directory

Bug: 337801
Change-Id: I5e0c4d838a211509fb4cc7e048dba6efaec15d5c
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
stable-0.12
Shawn O. Pearce 14 years ago
parent
commit
6444e60d0e
  1. 2
      org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/T0003_BasicTest.java
  2. 1
      org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileRepository.java

2
org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/T0003_BasicTest.java

@ -89,6 +89,7 @@ public class T0003_BasicTest extends SampleDataRepositoryTestCase {
@Test
public void test001_Initalize() {
final File gitdir = new File(trash, Constants.DOT_GIT);
final File hooks = new File(gitdir, "hooks");
final File objects = new File(gitdir, "objects");
final File objects_pack = new File(objects, "pack");
final File objects_info = new File(objects, "info");
@ -98,6 +99,7 @@ public class T0003_BasicTest extends SampleDataRepositoryTestCase {
final File HEAD = new File(gitdir, "HEAD");
assertTrue("Exists " + trash, trash.isDirectory());
assertTrue("Exists " + hooks, hooks.isDirectory());
assertTrue("Exists " + objects, objects.isDirectory());
assertTrue("Exists " + objects_pack, objects_pack.isDirectory());
assertTrue("Exists " + objects_info, objects_info.isDirectory());

1
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileRepository.java

@ -244,6 +244,7 @@ public class FileRepository extends Repository {
objectDatabase.create();
FileUtils.mkdir(new File(getDirectory(), "branches"));
FileUtils.mkdir(new File(getDirectory(), "hooks"));
RefUpdate head = updateRef(Constants.HEAD);
head.disableRefLog();

Loading…
Cancel
Save