]> source.dussan.org Git - jgit.git/commitdiff
Use proper constants for .gitignore and .git directory 55/1155/1
authorShawn O. Pearce <spearce@spearce.org>
Tue, 20 Jul 2010 16:11:39 +0000 (09:11 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Tue, 20 Jul 2010 16:11:39 +0000 (09:11 -0700)
We have a constant for .gitignore, so use it.  While we are in
the same method, correct the reference of ".git" to be the actual
GIT_DIR given.  This might not be within the work tree if the
GIT_DIR and GIT_WORK_TREE environment variables were used.

Change-Id: I38e1cec13405109b9c347858b38dd9fb2f1f2560
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
CC: Charley Wang <chwang@redhat.com>
CC: Chris Aniszczyk <caniszczyk@gmail.com>
CC: Stefan Lay <stefan.lay@sap.com>
CC: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit/src/org/eclipse/jgit/ignore/SimpleIgnoreCache.java

index 0d74e881c3c1518106a3d14bf9cd650b59de2872..fc346a98f0ae1ef01f0d9a28e81edee383ea8324 100644 (file)
@@ -130,13 +130,13 @@ public class SimpleIgnoreCache {
         */
        private void readRulesAtBase() {
                //Add .gitignore rules
-               String path =  new File(repository.getWorkDir(), ".gitignore").getAbsolutePath();
-               File f = new File(path);
+               File f = new File(repository.getWorkDir(), Constants.DOT_GIT_IGNORE);
+               String path = f.getAbsolutePath();
                IgnoreNode n = new IgnoreNode(f.getParentFile());
 
                //Add exclude rules
                //TODO: Get /info directory without string concat
-               path = new File(repository.getWorkDir(), ".git/info/exclude").getAbsolutePath();
+               path = new File(repository.getDirectory(), "info/exclude").getAbsolutePath();
                f = new File(path);
                if (f.canRead())
                        n.addSecondarySource(f);