Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #855: Adding debug detail for VCS errors #859

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion repo/vcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,26 @@ func VcsUpdate(dep *cfg.Dependency, force bool, updated *UpdateTracker) error {
if err != nil {
return err
}
} else if err == v.ErrWrongVCS {
tp, terr := v.DetectVcsFromFS(dest)
if terr != nil {
msg.Debug("Unable to detect local file system VCS")
} else {
msg.Debug("Expect VCS type %q but got %q for %s", dep.Vcs(), tp, dep.Name)
}

return fmt.Errorf("Wrong VCS type error: %s for dependency %s", err, dep.Name)
} else if err == v.ErrWrongRemote {
errR, terr := v.NewRepo("", dest)
if terr != nil {
msg.Debug("Unable to detect local file system repo location")
} else {
msg.Debug("Expect VCS location %q but got %q for %s", dep.Remote(), errR.Remote(), dep.Name)
}
return fmt.Errorf("Wrong VCS location error: %s for dependency %s", err, dep.Name)

} else if err != nil {
return err
return fmt.Errorf("Error: %s for dependency %s", err, dep.Name)
} else if repo.IsDirty() {
return fmt.Errorf("%s contains uncommitted changes. Skipping update", dep.Name)
}
Expand Down