findbuild: First build edge case
Support edge case where the first manifest file is non-empty, but does not contain the CL repository. Findbuild now correctly sets the source SHA as empty if the first non-empty manifest file does not contain the target repo.
BUG=160901711
TEST=unittests, run local
Change-Id: I386c46d70202296d416969d31da44ad0e3acbea9
diff --git a/src/pkg/findbuild/findbuild.go b/src/pkg/findbuild/findbuild.go
index a4579b1..3b6cac0 100644
--- a/src/pkg/findbuild/findbuild.go
+++ b/src/pkg/findbuild/findbuild.go
@@ -382,7 +382,7 @@
}
}
if output.SHA == "" || output.RemoteURL == "" {
- out <- manifestResponse{Err: fmt.Errorf("repository associated with CL could not be found in manifest %s", buildNum)}
+ out <- manifestResponse{BuildNum: buildNum, SHA: ""}
return
}
out <- output