aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/aflow/flow/patching/actions.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2026-02-02 08:17:28 +0100
committerDmitry Vyukov <dvyukov@google.com>2026-02-02 09:22:43 +0000
commit9a3a4862049c464b0fc12dff6a9bfc49e2d8bf03 (patch)
tree40b78b34f2201ecffdc88fc84e645eb1af72ce35 /pkg/aflow/flow/patching/actions.go
parent62be7008f950a8b59112b792a9099734ae54c157 (diff)
pkg/aflow/flow/patching: fix getting list of recent commits
We need to run git log in the master git repo b/c out KernelSrc/KernelScratchSrc are shallow checkouts that don't have history.
Diffstat (limited to 'pkg/aflow/flow/patching/actions.go')
-rw-r--r--pkg/aflow/flow/patching/actions.go20
1 files changed, 12 insertions, 8 deletions
diff --git a/pkg/aflow/flow/patching/actions.go b/pkg/aflow/flow/patching/actions.go
index d42c24fa1..bea70e978 100644
--- a/pkg/aflow/flow/patching/actions.go
+++ b/pkg/aflow/flow/patching/actions.go
@@ -114,7 +114,6 @@ func maintainers(ctx *aflow.Context, args maintainersArgs) (maintainersResult, e
var getRecentCommits = aflow.NewFuncAction("get-recent-commits", recentCommits)
type recentCommitsArgs struct {
- KernelSrc string
KernelCommit string
PatchDiff string
}
@@ -132,11 +131,16 @@ func recentCommits(ctx *aflow.Context, args recentCommitsArgs) (recentCommitsRes
if len(files) == 0 {
return res, aflow.FlowError(errors.New("patch diff does not contain any modified files"))
}
- gitArgs := append([]string{"log", "--format=%s", "--no-merges", "-n", "20", args.KernelCommit}, files...)
- output, err := osutil.RunCmd(10*time.Minute, args.KernelSrc, "git", gitArgs...)
- if err != nil {
- return res, aflow.FlowError(fmt.Errorf("%w\n%s", err, output))
- }
- res.RecentCommits = string(output)
- return res, nil
+ // We need to run git log in the master git repo b/c out KernelSrc/KernelScratchSrc
+ // are shallow checkouts that don't have history.
+ err := kernel.UseLinuxRepo(ctx, func(kernelRepoDir string, _ vcs.Repo) error {
+ gitArgs := append([]string{"log", "--format=%s", "--no-merges", "-n", "20", args.KernelCommit}, files...)
+ output, err := osutil.RunCmd(10*time.Minute, kernelRepoDir, "git", gitArgs...)
+ if err != nil {
+ return aflow.FlowError(fmt.Errorf("%w\n%s", err, output))
+ }
+ res.RecentCommits = string(output)
+ return nil
+ })
+ return res, err
}