git icon indicating copy to clipboard operation
git copied to clipboard

getCommit() fails during parsing

Open matthew-carroll opened this issue 6 years ago • 1 comments

I'm running gitDir.getCommit() using a hash that comes from myBranch.sha. I get the following error:

Unhandled exception:
Bad state: No element
#0      Iterable.single (dart:core/iterable.dart:552:25)
#1      Commit._parse (package:git/src/commit.dart:56:53)
#2      Commit.parse (package:git/src/commit.dart:28:17)
#3      GitDir.getCommit (package:git/src/git_dir.dart:40:19)
<asynchronous suspension>

I ran the same command with the same hash from my terminal and didn't notice any issue, except that the final line of terminal output does not include a newline. Would that break getCommit()?

matthew-carroll avatar Feb 16 '19 05:02 matthew-carroll

What repo did you run this on? Its likely due to a mergetag object or PGP signature in the git rev-list before the commit message.

ryanleecode avatar May 13 '19 01:05 ryanleecode