/// <summary> /// Converts this to a Head object /// </summary> /// <param name="directory">The directory to load the dependency</param> /// <returns></returns> public Head GetHead(DirectoryStructure directory) { if (TargetType == COMMIT) { Commit commit = directory.GetCommit(TargetHash); return(new Head(commit)); } else if (TargetType == BRANCH) { Branch branch = directory.LoadBranch(TargetHash); return(new Head(branch)); } else if (TargetType == UNINITIALIZED) { return(new Head()); } else { throw new FormatException("Head must point to either a Commit or a Branch"); } }
public Branch LoadBranch(string name) { return(directory.LoadBranch(name)); }