public void UpdateHead(Head head, Commit commit)
 {
     if (head.TargetType != Head.Target.Branch)
     {
         directory.ChangeHead(commit);
     }
     else
     {
         var branch    = head.TargetBranch;
         var newBranch = new Branch(commit, branch.Metadata, branch.Name);
         directory.UpdateBranch(newBranch);
     }
 }