Skip to content

Commit

Permalink
jj-codereview: make FETCH_HEAD visible to jj in fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
FiloSottile committed Jan 4, 2025
1 parent 891d099 commit 72c58a1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jj-codereview/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ Fetches a single CL by number, Change-Id, or other Gerrit query.
}

run("git", "fetch", c.Revisions[c.CurrentRevision].Fetch.HTTP.URL, c.Revisions[c.CurrentRevision].Fetch.HTTP.Ref)
ref := fmt.Sprintf("refs/remotes/gerrit/cl/%d/%d", c.Number, c.Revisions[c.CurrentRevision].Number)
if !*noRun {
for _, c := range jjLog("-T", "commit_id ++ '\n'", "-r", "::"+c.CurrentRevision+" ~ ::remote_bookmarks(remote=origin)") {
run("git", "update-ref", ref, "FETCH_HEAD")
for _, c := range jjLog("-T", "commit_id ++ '\n'", "-r", "::"+c.CurrentRevision+" ~ ::remote_bookmarks(remote=origin) ~ "+c.CurrentRevision) {
labelCommit(c, 5)
}
printf("%s", jjLog("-r", c.CurrentRevision)[0])
Expand Down

0 comments on commit 72c58a1

Please # to comment.