Skip to content

Commit c1fe14b

Browse files
committed
fix: jupiter check specified branch update
1 parent 37d2e51 commit c1fe14b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/core/cmd/cmd_new.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ func checkUpgrade(c *cli.Context, path string) bool {
309309
}
310310

311311
// 和本地对比,如果一致,那么不需要更新
312-
if getLocalLastSha(path) == remoteLastSha {
312+
if getLocalLastSha(path, c.String("branch")) == remoteLastSha {
313313
return false
314314
}
315315

@@ -404,8 +404,8 @@ func getRemoteLastCommitSha() (string, error) {
404404
}
405405

406406
// getLocalLastSha 获取本地最后一次的提交sha
407-
func getLocalLastSha(path string) string {
408-
cmd := exec.Command("git", "rev-parse", "main")
407+
func getLocalLastSha(path, branch string) string {
408+
cmd := exec.Command("git", "rev-parse", branch)
409409
cmd.Dir = getGlobalLayoutPath(path)
410410

411411
var out bytes.Buffer

0 commit comments

Comments
 (0)