diff options
author | Unknwon <u@gogs.io> | 2015-10-31 18:59:07 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-10-31 18:59:07 -0400 |
commit | fad31ca302e50af8fa2296b26606e3fd9469ebfc (patch) | |
tree | 51e66832d4811b4bbb7ec4b1cf5a68fc2d44918f /models/action.go | |
parent | 6b8bef3cf6c61459f8bec03aa05e2ebcd099f871 (diff) | |
download | gitea-fad31ca302e50af8fa2296b26606e3fd9469ebfc.tar.gz gitea-fad31ca302e50af8fa2296b26606e3fd9469ebfc.zip |
work on #1748
Diffstat (limited to 'models/action.go')
-rw-r--r-- | models/action.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/models/action.go b/models/action.go index e38cf593b8..6e3587e0eb 100644 --- a/models/action.go +++ b/models/action.go @@ -337,6 +337,14 @@ func CommitRepoAction( return fmt.Errorf("GetOwner: %v", err) } + // Change repository bare status and update last updated time. + if repo.IsBare { + repo.IsBare = false + if err = UpdateRepository(repo, false); err != nil { + return fmt.Errorf("UpdateRepository: %v", err) + } + } + isNewBranch := false opType := COMMIT_REPO // Check it's tag push or branch. @@ -351,12 +359,6 @@ func CommitRepoAction( isNewBranch = true } - // Change repository bare status and update last updated time. - repo.IsBare = false - if err = UpdateRepository(repo, false); err != nil { - return fmt.Errorf("UpdateRepository: %v", err) - } - if err = updateIssuesCommit(u, repo, repoUserName, repoName, commit.Commits); err != nil { log.Error(4, "updateIssuesCommit: %v", err) } |