From 9bf728d8508f11796573b7f859305c8834af2243 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sat, 20 Dec 2025 13:10:17 -0300 Subject: [PATCH] git: nip34 state as fake heads instead of fake remotes. --- git.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git.go b/git.go index e599b97..36ccf68 100644 --- a/git.go +++ b/git.go @@ -1101,7 +1101,7 @@ func gitUpdateRefs(ctx context.Context, dir string, state nip34.RepositoryState) lines := strings.Split(string(output), "\n") for _, line := range lines { parts := strings.Fields(line) - if len(parts) >= 2 && strings.Contains(parts[1], "refs/remotes/nip34/state/") { + if len(parts) >= 2 && strings.Contains(parts[1], "refs/heads/nip34/state/") { delCmd := exec.Command("git", "update-ref", "-d", parts[1]) if dir != "" { delCmd.Dir = dir @@ -1118,7 +1118,7 @@ func gitUpdateRefs(ctx context.Context, dir string, state nip34.RepositoryState) branchName = "refs/heads/" + branchName } - refName := "refs/remotes/nip34/state/" + strings.TrimPrefix(branchName, "refs/heads/") + refName := "refs/heads/nip34/state/" + strings.TrimPrefix(branchName, "refs/heads/") updateCmd := exec.Command("git", "update-ref", refName, commit) if dir != "" { updateCmd.Dir = dir @@ -1131,7 +1131,7 @@ func gitUpdateRefs(ctx context.Context, dir string, state nip34.RepositoryState) // create ref for HEAD if state.HEAD != "" { if headCommit, ok := state.Branches[state.HEAD]; ok { - headRefName := "refs/remotes/nip34/state/HEAD" + headRefName := "refs/heads/nip34/state/HEAD" updateCmd := exec.Command("git", "update-ref", headRefName, headCommit) if dir != "" { updateCmd.Dir = dir