downloader: Don't consider invalid commit strings
When retrieving a repo's commits that are equivalent to the given one
(CommitsFor()), don't always include the given string in the results.
If the given string does not specify a valid commit, then the empty set
is returned.
This change allows newt to detect when a commit string is invalid.
diff --git a/newt/downloader/downloader.go b/newt/downloader/downloader.go
index 6f4a7bd..53c0457 100644
--- a/newt/downloader/downloader.go
+++ b/newt/downloader/downloader.go
@@ -580,9 +580,6 @@
var commits []string
- // Always insert the specified string into the set.
- commits = append(commits, commit)
-
// Add all commits that are equivalent to the specified string.
for _, c := range gd.commits {
if commit == c.hash {