]> source.dussan.org Git - gitea.git/commitdiff
#1544 better tmp dir name for creating repo
authorUnknwon <u@gogs.io>
Thu, 3 Sep 2015 08:44:20 +0000 (04:44 -0400)
committerUnknwon <u@gogs.io>
Thu, 3 Sep 2015 08:44:20 +0000 (04:44 -0400)
models/action.go
models/repo.go

index 1abc7363d2dcb6ae18badbe3ad5372162bb23a9d..07f5b17a79f7b8ab95fdc886ca52a946377723c0 100644 (file)
@@ -226,6 +226,7 @@ func updateIssuesCommit(u *User, repo *Repository, repoUserName, repoName string
                }
 
                refMarked = make(map[int64]bool)
+               // FIXME: can merge this one and next one to a common function.
                for _, ref := range IssueCloseKeywordsPat.FindAllString(c.Message, -1) {
                        ref = ref[strings.IndexByte(ref, byte(' '))+1:]
                        ref = strings.TrimRightFunc(ref, issueIndexTrimRight)
@@ -237,7 +238,7 @@ func updateIssuesCommit(u *User, repo *Repository, repoUserName, repoName string
                        // Add repo name if missing
                        if ref[0] == '#' {
                                ref = fmt.Sprintf("%s/%s%s", repoUserName, repoName, ref)
-                       } else if strings.Contains(ref, "/") == false {
+                       } else if !strings.Contains(ref, "/") {
                                // We don't support User#ID syntax yet
                                // return ErrNotImplemented
                                continue
@@ -274,7 +275,7 @@ func updateIssuesCommit(u *User, repo *Repository, repoUserName, repoName string
                        // Add repo name if missing
                        if ref[0] == '#' {
                                ref = fmt.Sprintf("%s/%s%s", repoUserName, repoName, ref)
-                       } else if strings.Contains(ref, "/") == false {
+                       } else if !strings.Contains(ref, "/") {
                                // We don't support User#ID syntax yet
                                // return ErrNotImplemented
                                continue
index 706bb90fa451e4bacefd7d5a7feadc0bd6d9ee79..cda0c0b98a8884a6b8ac85e2158c173a494f94f9 100644 (file)
@@ -610,8 +610,8 @@ func initRepository(e Engine, repoPath string, u *User, repo *Repository, opts C
                return err
        }
 
-       tmpDir := filepath.Join(os.TempDir(), "gogs", repo.Name, com.ToStr(time.Now().Nanosecond()))
-
+       tmpDir := filepath.Join(os.TempDir(), "gogs-"+repo.Name+"-"+com.ToStr(time.Now().Nanosecond()))
+       fmt.Println(tmpDir)
        // Initialize repository according to user's choice.
        if opts.AutoInit {
                os.MkdirAll(tmpDir, os.ModePerm)