@@ -123,23 +123,23 @@ func getDivergenceCacheKey(repoID int64, branchName string) string {
123123}
124124
125125// getDivergenceFromCache gets the divergence from cache 
126- func  getDivergenceFromCache (repoID  int64 , branchName  string ) (* git .DivergeObject , bool ) {
126+ func  getDivergenceFromCache (repoID  int64 , branchName  string ) (* gitrepo .DivergeObject , bool ) {
127127	data , ok  :=  cache .GetCache ().Get (getDivergenceCacheKey (repoID , branchName ))
128- 	res  :=  git .DivergeObject {
128+ 	res  :=  & gitrepo .DivergeObject {
129129		Ahead :  - 1 ,
130130		Behind : - 1 ,
131131	}
132132	if  ! ok  ||  data  ==  ""  {
133- 		return  & res , false 
133+ 		return  res , false 
134134	}
135135	if  err  :=  json .Unmarshal (util .UnsafeStringToBytes (data ), & res ); err  !=  nil  {
136136		log .Error ("json.UnMarshal failed: %v" , err )
137- 		return  & res , false 
137+ 		return  res , false 
138138	}
139- 	return  & res , true 
139+ 	return  res , true 
140140}
141141
142- func  putDivergenceFromCache (repoID  int64 , branchName  string , divergence  * git .DivergeObject ) error  {
142+ func  putDivergenceFromCache (repoID  int64 , branchName  string , divergence  * gitrepo .DivergeObject ) error  {
143143	bs , err  :=  json .Marshal (divergence )
144144	if  err  !=  nil  {
145145		return  err 
@@ -178,7 +178,7 @@ func loadOneBranch(ctx context.Context, repo *repo_model.Repository, dbBranch *g
178178	p  :=  protectedBranches .GetFirstMatched (branchName )
179179	isProtected  :=  p  !=  nil 
180180
181- 	var  divergence  * git .DivergeObject 
181+ 	var  divergence  * gitrepo .DivergeObject 
182182
183183	// it's not default branch 
184184	if  repo .DefaultBranch  !=  dbBranch .Name  &&  ! dbBranch .IsDeleted  {
@@ -199,7 +199,7 @@ func loadOneBranch(ctx context.Context, repo *repo_model.Repository, dbBranch *g
199199
200200	if  divergence  ==  nil  {
201201		// tolerate the error that we cannot get divergence 
202- 		divergence  =  & git .DivergeObject {Ahead : - 1 , Behind : - 1 }
202+ 		divergence  =  & gitrepo .DivergeObject {Ahead : - 1 , Behind : - 1 }
203203	}
204204
205205	pr , err  :=  issues_model .GetLatestPullRequestByHeadInfo (ctx , repo .ID , branchName )
@@ -720,7 +720,7 @@ func GetBranchDivergingInfo(ctx reqctx.RequestContext, baseRepo *repo_model.Repo
720720	// if the fork repo has new commits, this call will fail because they are not in the base repo 
721721	// exit status 128 - fatal: Invalid symmetric difference expression aaaaaaaaaaaa...bbbbbbbbbbbb 
722722	// so at the moment, we first check the update time, then check whether the fork branch has base's head 
723- 	diff , err  :=  git .GetDivergingCommits (ctx , baseRepo . RepoPath () , baseGitBranch .CommitID , headGitBranch .CommitID )
723+ 	diff , err  :=  gitrepo .GetDivergingCommits (ctx , baseRepo , baseGitBranch .CommitID , headGitBranch .CommitID )
724724	if  err  !=  nil  {
725725		info .BaseHasNewCommits  =  baseGitBranch .UpdatedUnix  >  headGitBranch .UpdatedUnix 
726726		if  headRepo .IsFork  &&  info .BaseHasNewCommits  {
0 commit comments