Skip to content

Commit bbd4b05

Browse files
committed
fix bug
1 parent bf912f6 commit bbd4b05

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

form/form.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"encoding/json"
66
"io"
7-
"os"
87

98
"github.com/go-git/go-billy/v5"
109
"github.com/gov4git/lib4git/must"
@@ -41,7 +40,7 @@ func DecodeBytes[F Form](ctx context.Context, data []byte) (form F, err error) {
4140
}
4241

4342
func EncodeToFile[F Form](ctx context.Context, fs billy.Filesystem, path string, form F) error {
44-
file, err := fs.OpenFile(path, os.O_CREATE|os.O_RDWR, 0644)
43+
file, err := fs.Create(path)
4544
if err != nil {
4645
return err
4746
}

git/proxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func cloneToMemoryOrInit(ctx context.Context, addr Address) *Repository {
4444
return repo
4545
}
4646
_, isNoBranch := err.(git.NoMatchingRefSpecError)
47-
if !isNoBranch && err != transport.ErrEmptyRemoteRepository {
47+
if !isNoBranch && err != transport.ErrEmptyRemoteRepository && err != plumbing.ErrReferenceNotFound {
4848
must.Panic(ctx, err)
4949
}
5050
repo = initInMemory(ctx)

0 commit comments

Comments
 (0)