mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-09 23:15:49 +01:00
(refs #457)Fix the target of updateRef
This commit is contained in:
@@ -350,7 +350,7 @@ trait RepositoryViewerControllerBase extends ControllerBase {
|
||||
val builder = DirCache.newInCore.builder()
|
||||
val inserter = git.getRepository.newObjectInserter()
|
||||
val headName = s"refs/heads/${branch}"
|
||||
val headTip = git.getRepository.resolve(s"refs/heads/${branch}")
|
||||
val headTip = git.getRepository.resolve(headName)
|
||||
|
||||
JGitUtil.processTree(git, headTip){ (path, tree) =>
|
||||
if(!newPath.exists(_ == path) && !oldPath.exists(_ == path)){
|
||||
@@ -365,7 +365,7 @@ trait RepositoryViewerControllerBase extends ControllerBase {
|
||||
builder.finish()
|
||||
|
||||
val commitId = JGitUtil.createNewCommit(git, inserter, headTip, builder.getDirCache.writeTree(inserter),
|
||||
loginAccount.fullName, loginAccount.mailAddress, message)
|
||||
headName, loginAccount.fullName, loginAccount.mailAddress, message)
|
||||
|
||||
inserter.flush()
|
||||
inserter.release()
|
||||
|
||||
Reference in New Issue
Block a user