title: cannot parse object when trying to reset git HEAD to last commit
body: <p>I have a a subprocess  command that runs on the server that reset git head to the last commit. like this</p>
  
  <pre><code>args = [
      "git",
      "reset",
      "--hard",
      str(self.commit_id),
  ]
  
  process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=self.project_directory)
  stdout = process.communicate()[0]
  
  if process.returncode != 0:
      error_text = "Error attempting to reset to '{}'\n".format(self.commit_id)
      error_text += "Command: {}\n".format(" ".join(args))
      error_text += "Output: \n"
      error_text += stdout
  </code></pre>
  
  <p>but this throws error: </p>
  
  <pre><code>SystemError: Error attempting to reset to '9eada053b68fbe7209096b214294959f90a87b67'
  Command: git reset --hard 9eada053b68fbe7209096b214232329f90a87b67
  Output:
  fatal: Could not parse object '9eada053b68fbe7209096b214232329f90a87b67'.
  </code></pre>
  
  <p>9eada053b68fbe7209096b214232329f90a87b67 is the last commit on the branch.</p>