aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ReceivePack.java
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2010-01-14 23:53:11 +0100
committerRobin Rosenberg <robin.rosenberg@dewire.com>2010-01-15 07:17:34 +0100
commit0b8b6b5309f2510f1a2e1c3d77942fa9470dd324 (patch)
treeb501b146827de359e3c6c5adfee07d8f0f311abb /org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ReceivePack.java
parentf5eb0d93660786213b98dadde7d93c5605454495 (diff)
downloadjgit-0b8b6b5309f2510f1a2e1c3d77942fa9470dd324.tar.gz
jgit-0b8b6b5309f2510f1a2e1c3d77942fa9470dd324.zip
Introduce a named constant for the .git directory.
Not all occurrences of ".git" are replaced by this constant, only those where it actually refers to the directory with that name, i.e not the ".git" directory suffix. Asserts and comment are also excluded from replacement. Change-Id: I65a9da89aedd53817f2ea3eaab4f9c2bed35d7ee Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ReceivePack.java')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ReceivePack.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ReceivePack.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ReceivePack.java
index c6a6fd0cbf..f43a2793ee 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ReceivePack.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/ReceivePack.java
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2008-2009, Google Inc.
- * Copyright (C) 2009, Robin Rosenberg <robin.rosenberg@dewire.com>
+ * Copyright (C) 2009-2010, Robin Rosenberg <robin.rosenberg@dewire.com>
* and other copyright owners as documented in the project's IP log.
*
* This program and the accompanying materials are made available
@@ -47,6 +47,7 @@ package org.eclipse.jgit.pgm;
import java.io.File;
import org.kohsuke.args4j.Argument;
+import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.Repository;
@Command(common = false, usage = "Server side backend for 'jgit push'")
@@ -63,8 +64,8 @@ class ReceivePack extends TextBuiltin {
protected void run() throws Exception {
final org.eclipse.jgit.transport.ReceivePack rp;
- if (new File(dstGitdir, ".git").isDirectory())
- dstGitdir = new File(dstGitdir, ".git");
+ if (new File(dstGitdir, Constants.DOT_GIT).isDirectory())
+ dstGitdir = new File(dstGitdir, Constants.DOT_GIT);
db = new Repository(dstGitdir);
if (!db.getObjectsDirectory().isDirectory())
throw die("'" + dstGitdir.getPath() + "' not a git repository");