Skip to content

Commit 654cdad

Browse files
committed
Refactor.
1 parent 3b6f51a commit 654cdad

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

server/git.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type GitRef struct {
2525

2626
// list repo refs using `git ls-remote repo`
2727
func listRepoRefs(repo string) (refs []GitRef, err error) {
28-
cacheKey := fmt.Sprintf("gh:%s", repo)
28+
cacheKey := fmt.Sprintf("git ls-remote %s", repo)
2929
lock := getFetchLock(cacheKey)
3030
lock.Lock()
3131
defer lock.Unlock()

server/npm.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,11 @@ func fetchPackageInfo(name string, version string) (info NpmPackageInfo, err err
237237
}
238238
}()
239239

240+
if cfg == nil {
241+
err = fmt.Errorf("unknown npm registry")
242+
return
243+
}
244+
240245
isJsrScope := strings.HasPrefix(name, "@jsr/")
241246
url := cfg.NpmRegistry + name
242247
if isJsrScope {

0 commit comments

Comments
 (0)