Correctly handle missing refs/meta/config branch
If the refs/meta/config branch does not exist, getRevision() used to throw NPE when trying to access the ProjectDetail. This is because on a missing branch the revision field is null, and must return a null to the caller rather than copying the value. Change-Id: If4dd771d39382b89443a234f16d13a7a4e6838c8
This commit is contained in:
@@ -66,7 +66,7 @@ public abstract class VersionedMetaData {
|
||||
|
||||
/** @return revision of the metadata that was loaded. */
|
||||
public ObjectId getRevision() {
|
||||
return revision.copy();
|
||||
return revision != null ? revision.copy() : null;
|
||||
}
|
||||
|
||||
/** Initialize in-memory as though the repository branch doesn't exist. */
|
||||
|
||||
Reference in New Issue
Block a user