File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,9 @@ const tryGit = async (path, ...args) => {
19
19
20
20
// parse a repo from a git origin into a format
21
21
// for a package.json#repository object
22
- const getUrl = async ( path ) => {
22
+ const getRemoteUrl = async ( path , remote ) => {
23
23
try {
24
- const urlStr = await tryGit ( path , 'remote' , 'get-url' , 'origin' )
24
+ const urlStr = await tryGit ( path , 'remote' , 'get-url' , remote )
25
25
const { domain, user, project } = hgi . fromUrl ( urlStr )
26
26
const url = new URL ( `https://${ domain } ` )
27
27
url . pathname = `/${ user } /${ project } .git`
@@ -31,6 +31,10 @@ const getUrl = async (path) => {
31
31
}
32
32
}
33
33
34
+ const getUrl = async ( path ) => {
35
+ return ( await getRemoteUrl ( path , 'upstream' ) ) ?? ( await getRemoteUrl ( path , 'origin' ) )
36
+ }
37
+
34
38
const getBranches = async ( path , branchPatterns ) => {
35
39
let matchingBranches = new Set ( )
36
40
let matchingPatterns = new Set ( )
You can’t perform that action at this time.
0 commit comments