Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • bazel/git
1 result
Show changes
Commits on Source (4)
# [1.0.0-alpha.7](https://git.gitlab.arm.com/bazel/git/compare/v1.0.0-alpha.6...v1.0.0-alpha.7) (2024-04-19)
### Bug Fixes
- **fetch:** output `remote error: want {} not valid` error message when SHA unadvertised ([08ef880](https://git.gitlab.arm.com/bazel/git/commit/08ef8807ae34f468400e77d9331c4a6f633f243a))
# [1.0.0-alpha.6](https://git.gitlab.arm.com/bazel/git/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2024-04-19)
### Features
......
module(
name = "bazel-git",
version = "1.0.0-alpha.6",
version = "1.0.0-alpha.7",
bazel_compatibility = [
">=7.0.0",
],
......
......@@ -37,8 +37,7 @@ func (x *CatFileCommand) Execute(rest []string) error {
log.Debug("resolve")
hash, err := repo.ResolveRevision(x.Args.Revision)
if x.Exists && err == plumbing.ErrReferenceNotFound {
// TODO: remove the message
return NewExitCodeError(1, "Not found")
return NewExitCodeError(1, "")
}
if err != nil {
log.Error("resolve", "err", err)
......@@ -66,8 +65,7 @@ func (x *CatFileCommand) Execute(rest []string) error {
log.Debug("file", "filepath", filepath)
_, err = tree.File(filepath)
if err == object.ErrFileNotFound {
// TODO: remove the message
return NewExitCodeError(1, "Not found")
return NewExitCodeError(1, "")
}
if err != nil {
log.Error("tree", "err", err)
......
......@@ -177,9 +177,18 @@ func (x *FetchCommand) Execute(rest []string) error {
Depth: x.Depth,
Progress: progress,
})
if !(err == nil || err == git.NoErrAlreadyUpToDate) {
switch err {
case git.ErrExactSHA1NotSupported:
wants := make([]string, len(refSpecs))
for i, refSpec := range refSpecs {
wants[i] = refSpec.Src()
}
return NewExitCodeError(128, fmt.Sprintf("remote error: want %s not valid", strings.Join(wants, ",")))
default:
log.Error("fetch", "err", err)
return err
case git.NoErrAlreadyUpToDate:
case nil:
}
if !x.NoWriteFetchHead {
......
......@@ -97,8 +97,7 @@ func (x *LsRemoteCommand) Execute(rest []string) error {
}
if !found && x.ExitCode {
// TODO: remove the message
return NewExitCodeError(2, "references unfound")
return NewExitCodeError(2, "")
}
return nil
......
......@@ -43,6 +43,9 @@ func main() {
if _, err := parser.Parse(); err != nil {
switch e := err.(type) {
case *ExitCodeError:
if e.Error() != "" {
fmt.Fprintf(os.Stderr, "fatal: %s\n", e)
}
os.Exit(e.ExitCode)
case *flags.Error:
switch e.Type {
......