]> source.dussan.org Git - jgit.git/commitdiff
Fix unit tests using MockSystemReader with user configuation 59/559/1
authorShawn O. Pearce <spearce@spearce.org>
Thu, 15 Apr 2010 01:39:19 +0000 (18:39 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Thu, 15 Apr 2010 01:39:19 +0000 (18:39 -0700)
Since cc905e7d4be "Make Repository.getConfig aware of changed config"
its invalid to have a null result from FileBasedConfig.getFile(), as
the path is used to stat the location on disk before returning the
Config object from Repository.getConfig().

Mock out the isOutdated() method to return false all of the time
in the mock test environment, so we don't crash with an NPE when
this mock user configuration is being called.

Change-Id: I0b4d9cbd346d5dc225ec12674da905c35457fa7c
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java

index 306d432e63c1533181ee05eeeab98c7f9b36a4c4..b4f0b7e90913a6a4ac02f5420cdc2637fb86e2c7 100644 (file)
@@ -70,7 +70,13 @@ public class MockSystemReader extends SystemReader {
                        @Override
                        public void load() throws IOException, ConfigInvalidException {
                                // Do nothing
-                       }};
+                       }
+
+                       @Override
+                       public boolean isOutdated() {
+                               return false;
+                       }
+               };
        }
 
        private void init(final String n) {