From 142ebf6f82a991b84f8774d262f717c19cb3392f Mon Sep 17 00:00:00 2001 From: Ilya Dmitrichenko Date: Mon, 18 Dec 2017 16:27:48 +0000 Subject: [PATCH] Improve error message for new packages Signed-off-by: Ilya Dmitrichenko --- src/cmd/linuxkit/pkglib/git.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cmd/linuxkit/pkglib/git.go b/src/cmd/linuxkit/pkglib/git.go index 2e4dc70b8..7341132a6 100644 --- a/src/cmd/linuxkit/pkglib/git.go +++ b/src/cmd/linuxkit/pkglib/git.go @@ -89,6 +89,10 @@ func (g git) treeHash(pkg, commit string) (string, error) { return "", err } + if out == "" { + return "", fmt.Errorf("Package %s is not in git", pkg) + } + matches := treeHashRe.FindStringSubmatch(out) if len(matches) != 2 { return "", fmt.Errorf("Unable to parse ls-tree output: %q", out)