Skip to content

Commit

Permalink
Merge pull request #2545 from coryb/umask-git-panic
Browse files Browse the repository at this point in the history
fix panic from umask-git on invalid ref
  • Loading branch information
coryb authored Jan 4, 2022
2 parents a8278dd + 397c98b commit 1725efc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions source/git/gitsource_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os"
"os/exec"
"os/signal"
"syscall"
"time"

"github.com/docker/docker/pkg/reexec"
Expand Down Expand Up @@ -63,8 +64,12 @@ func gitMain() {
close(done)
if err != nil {
if exiterr, ok := err.(*exec.ExitError); ok {
status := exiterr.Sys().(unix.WaitStatus)
os.Exit(status.ExitStatus())
switch status := exiterr.Sys().(type) {
case unix.WaitStatus:
os.Exit(status.ExitStatus())
case syscall.WaitStatus:
os.Exit(status.ExitStatus())
}
}
os.Exit(1)
}
Expand Down

0 comments on commit 1725efc

Please sign in to comment.