|
|
@ -178,6 +178,7 @@ Gitea or set your environment appropriately.`, "") |
|
|
|
GitAlternativeObjectDirectories: os.Getenv(private.GitAlternativeObjectDirectories), |
|
|
|
GitObjectDirectory: os.Getenv(private.GitObjectDirectory), |
|
|
|
GitQuarantinePath: os.Getenv(private.GitQuarantinePath), |
|
|
|
GitPushOptions: pushOptions(), |
|
|
|
ProtectedBranchID: prID, |
|
|
|
IsDeployKey: isDeployKey, |
|
|
|
} |
|
|
@ -326,6 +327,7 @@ Gitea or set your environment appropriately.`, "") |
|
|
|
GitAlternativeObjectDirectories: os.Getenv(private.GitAlternativeObjectDirectories), |
|
|
|
GitObjectDirectory: os.Getenv(private.GitObjectDirectory), |
|
|
|
GitQuarantinePath: os.Getenv(private.GitQuarantinePath), |
|
|
|
GitPushOptions: pushOptions(), |
|
|
|
} |
|
|
|
oldCommitIDs := make([]string, hookBatchSize) |
|
|
|
newCommitIDs := make([]string, hookBatchSize) |
|
|
@ -438,3 +440,17 @@ func hookPrintResults(results []private.HookPostReceiveBranchResult) { |
|
|
|
os.Stderr.Sync() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func pushOptions() map[string]string { |
|
|
|
opts := make(map[string]string) |
|
|
|
if pushCount, err := strconv.Atoi(os.Getenv(private.GitPushOptionCount)); err == nil { |
|
|
|
for idx := 0; idx < pushCount; idx++ { |
|
|
|
opt := os.Getenv(fmt.Sprintf("GIT_PUSH_OPTION_%d", idx)) |
|
|
|
kv := strings.SplitN(opt, "=", 2) |
|
|
|
if len(kv) == 2 { |
|
|
|
opts[kv[0]] = kv[1] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return opts |
|
|
|
} |