diff options
author | Sasa Zivkov <sasa.zivkov@sap.com> | 2010-11-05 16:01:10 +0100 |
---|---|---|
committer | Sasa Zivkov <sasa.zivkov@sap.com> | 2010-11-05 16:06:14 +0100 |
commit | af4f6c512530f90b1ed1590f4bc88b7aa690182e (patch) | |
tree | de12795915265b94a9aec6aa027ee76da778e540 /org.eclipse.jgit.pgm/src | |
parent | 009507ca2eafe1c6218ca3779348452495dcd3a3 (diff) | |
download | jgit-af4f6c512530f90b1ed1590f4bc88b7aa690182e.tar.gz jgit-af4f6c512530f90b1ed1590f4bc88b7aa690182e.zip |
Fixed the git init to properly set bare=true
When --git-dir=X is given JGit creates a bare repository in the
directory X. However, when the --bare option is not explicitly
given, this is not properly reflected in the X/config file i.e.
the bare=true is missing. This change fixes this minor issue.
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm/src')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Init.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Init.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Init.java index c5a696a57f..89a08fda62 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Init.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Init.java @@ -2,6 +2,7 @@ * Copyright (C) 2009, Constantine Plotnikov <constantine.plotnikov@gmail.com> * Copyright (C) 2008, Google Inc. * Copyright (C) 2010, Robin Rosenberg <robin.rosenberg@dewire.com> + * Copyright (C) 2010, Sasa Zivkov <sasa.zivkov@sap.com> * and other copyright owners as documented in the project's IP log. * * This program and the accompanying materials are made available @@ -66,6 +67,8 @@ class Init extends TextBuiltin { protected void run() throws Exception { if (gitdir == null) gitdir = new File(bare ? "." : Constants.DOT_GIT); + else + bare = true; db = new FileRepository(gitdir); db.create(bare); out.println(MessageFormat.format(CLIText.get().initializedEmptyGitRepositoryIn, gitdir.getAbsolutePath())); |