Merge pull request #2545 from coryb/umask-git-panic

fix panic from umask-git on invalid ref
master
coryb 2022-01-04 08:48:43 -08:00 committed by GitHub
commit 1725efc1f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

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