|
|
|
@ -182,10 +182,12 @@ public class FileRepository extends Repository {
|
|
|
|
|
getFS()); |
|
|
|
|
else |
|
|
|
|
systemConfig = new FileBasedConfig(null, FS.DETECTED) { |
|
|
|
|
@Override |
|
|
|
|
public void load() { |
|
|
|
|
// empty, do not load
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean isOutdated() { |
|
|
|
|
// regular class would bomb here
|
|
|
|
|
return false; |
|
|
|
@ -202,6 +204,7 @@ public class FileRepository extends Repository {
|
|
|
|
|
loadRepoConfig(); |
|
|
|
|
|
|
|
|
|
repoConfig.addChangeListener(new ConfigChangedListener() { |
|
|
|
|
@Override |
|
|
|
|
public void onConfigChanged(ConfigChangedEvent event) { |
|
|
|
|
fireEvent(event); |
|
|
|
|
} |
|
|
|
@ -284,6 +287,7 @@ public class FileRepository extends Repository {
|
|
|
|
|
* @throws IOException |
|
|
|
|
* in case of IO problem |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public void create(boolean bare) throws IOException { |
|
|
|
|
final FileBasedConfig cfg = getConfig(); |
|
|
|
|
if (cfg.getFile().exists()) { |
|
|
|
@ -381,21 +385,20 @@ public class FileRepository extends Repository {
|
|
|
|
|
return objectDatabase.getDirectory(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @return the object database which stores this repository's data. |
|
|
|
|
*/ |
|
|
|
|
/** @return the object database storing this repository's data. */ |
|
|
|
|
@Override |
|
|
|
|
public ObjectDirectory getObjectDatabase() { |
|
|
|
|
return objectDatabase; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** @return the reference database which stores the reference namespace. */ |
|
|
|
|
@Override |
|
|
|
|
public RefDatabase getRefDatabase() { |
|
|
|
|
return refs; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @return the configuration of this repository |
|
|
|
|
*/ |
|
|
|
|
/** @return the configuration of this repository. */ |
|
|
|
|
@Override |
|
|
|
|
public FileBasedConfig getConfig() { |
|
|
|
|
if (systemConfig.isOutdated()) { |
|
|
|
|
try { |
|
|
|
@ -484,6 +487,7 @@ public class FileRepository extends Repository {
|
|
|
|
|
* |
|
|
|
|
* @return unmodifiable collection of other known objects. |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public Set<ObjectId> getAdditionalHaves() { |
|
|
|
|
HashSet<ObjectId> r = new HashSet<ObjectId>(); |
|
|
|
|
for (AlternateHandle d : objectDatabase.myAlternates()) { |
|
|
|
@ -522,9 +526,7 @@ public class FileRepository extends Repository {
|
|
|
|
|
detectIndexChanges(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Detect index changes. |
|
|
|
|
*/ |
|
|
|
|
/** Detect index changes. */ |
|
|
|
|
private void detectIndexChanges() { |
|
|
|
|
if (isBare()) |
|
|
|
|
return; |
|
|
|
@ -548,6 +550,7 @@ public class FileRepository extends Repository {
|
|
|
|
|
* named ref does not exist. |
|
|
|
|
* @throws IOException the ref could not be accessed. |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public ReflogReader getReflogReader(String refName) throws IOException { |
|
|
|
|
Ref ref = findRef(refName); |
|
|
|
|
if (ref != null) |
|
|
|
@ -585,6 +588,7 @@ public class FileRepository extends Repository {
|
|
|
|
|
globalAttributesNode = new GlobalAttributesNode(repo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public AttributesNode getInfoAttributesNode() throws IOException { |
|
|
|
|
if (infoAttributesNode instanceof InfoAttributesNode) |
|
|
|
|
infoAttributesNode = ((InfoAttributesNode) infoAttributesNode) |
|
|
|
@ -592,6 +596,7 @@ public class FileRepository extends Repository {
|
|
|
|
|
return infoAttributesNode; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public AttributesNode getGlobalAttributesNode() throws IOException { |
|
|
|
|
if (globalAttributesNode instanceof GlobalAttributesNode) |
|
|
|
|
globalAttributesNode = ((GlobalAttributesNode) globalAttributesNode) |
|
|
|
@ -625,5 +630,4 @@ public class FileRepository extends Repository {
|
|
|
|
|
throw new JGitInternalException(JGitText.get().gcFailed, e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|