Never sign byre's own commits on the server
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -13,20 +12,12 @@ func signingCmd(args []string) {
|
||||
usage()
|
||||
}
|
||||
checkout := args[0]
|
||||
common := gitOut(checkout, "rev-parse", "--path-format=absolute", "--git-common-dir")
|
||||
if gitOut(checkout, "rev-parse", "--path-format=absolute", "--git-dir") != common {
|
||||
fatal("checkout is a linked worktree; run byre signing on its main checkout", "checkout", checkout)
|
||||
}
|
||||
unsigned := filepath.Join(common, "unsigned.gitconfig")
|
||||
gitOut(checkout, "config", "commit.gpgsign", "true")
|
||||
gitOut(checkout, "config", "--file", unsigned, "commit.gpgsign", "false")
|
||||
gitOut(checkout, "config", "includeIf.gitdir:"+filepath.Join(common, "worktrees")+"/**.path", "unsigned.gitconfig")
|
||||
signing := gitOut(checkout, "config", "--type=bool", "--get", "commit.gpgsign")
|
||||
if signing != "true" {
|
||||
fatal("checkout's commit.gpgsign is not true after setting it", "checkout", checkout, "value", signing)
|
||||
}
|
||||
fmt.Printf("%s: commit.gpgsign %s\n", checkout, signing)
|
||||
fmt.Printf("%s/worktrees/*: commit.gpgsign %s\n", common, gitOut(checkout, "config", "--file", unsigned, "--type=bool", "--get", "commit.gpgsign"))
|
||||
}
|
||||
|
||||
func gitOut(dir string, args ...string) string {
|
||||
|
||||
Reference in New Issue
Block a user