title: Getting a Git repo submodule's target hash/SHA via Octokit.net?
body: <p>Is there any way to see the current target SHA of a GitHub repository submodule via Octokit[.net] (without cloning it locally)?</p>
  
  <p>I've been able to track down all the submodules by retrieving the <strong>.gitmodules</strong> file from the "parent" repo, but that file doesn't maintain where the submodule is pointing with in that submodule repo.</p>
  
  <h2>Prior attempts</h2>
  
  <p>After finding someone getting this information by indexing into a commit by the submodule path using LibGit2Sharp, I gave that a similar try in Octokit.</p>
  
  <pre class="lang-cs prettyprint-override"><code>var submodulePathContents = await repositoriesClient.Content.GetAllContents(parentRepoId, "path/to/submodule");
  </code></pre>
  
  <p>While stepping through this code in the debugger, I see this in Locals/Autos, so it definitely knew I was pointing it to a submodule path.</p>
  
  <blockquote>
    <p>System.Collections.Generic.IReadOnlyList.this[int].get Name:
    mono-tools Path: path/to/submodule Type:Submodule
    Octokit.RepositoryContent</p>
  </blockquote>
  
  <p>Unfortunately, when I get the actual content from that list, <code>submodulePathContents[0].Content</code> is just <code>null</code>.</p>
  
  <p>The GitHub web interface definitely surfaces this information when you navigate to a submodule's parent directory, so it makes me think I've just tried the wrong approach.</p>
  
  <p><a href="https://i.stack.imgur.com/bZjcL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bZjcL.png" alt="GitHub showing a submodule&#39;s target hash in the web interface."></a></p>
  
  <p>Is there some other magic way in the Octokit APIs that I've missed to get this submodule target hash?</p>