We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37d2e51 commit c1fe14bCopy full SHA for c1fe14b
pkg/core/cmd/cmd_new.go
@@ -309,7 +309,7 @@ func checkUpgrade(c *cli.Context, path string) bool {
309
}
310
311
// 和本地对比,如果一致,那么不需要更新
312
- if getLocalLastSha(path) == remoteLastSha {
+ if getLocalLastSha(path, c.String("branch")) == remoteLastSha {
313
return false
314
315
@@ -404,8 +404,8 @@ func getRemoteLastCommitSha() (string, error) {
404
405
406
// getLocalLastSha 获取本地最后一次的提交sha
407
-func getLocalLastSha(path string) string {
408
- cmd := exec.Command("git", "rev-parse", "main")
+func getLocalLastSha(path, branch string) string {
+ cmd := exec.Command("git", "rev-parse", branch)
409
cmd.Dir = getGlobalLayoutPath(path)
410
411
var out bytes.Buffer
0 commit comments