From 13a7e4802b1ae78cb9daef7659e927516efa17e1 Mon Sep 17 00:00:00 2001 From: z Date: Thu, 23 Jul 2020 11:04:02 +0800 Subject: [PATCH] * finish task #7426. --- module/repo/control.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/module/repo/control.php b/module/repo/control.php index 940ebdb060..8e463f5595 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -407,7 +407,16 @@ class repo extends control $history = $this->dao->select('*')->from(TABLE_REPOHISTORY)->where('revision')->eq($log[0]->revision)->andWhere('repo')->eq($repoID)->fetch(); if($history) { - $oldRevision = $this->dao->select('revision')->from(TABLE_REPOHISTORY)->where('commit')->eq($history->commit - 1)->andWhere('repo')->eq($repoID)->fetch('revision'); + $prevHistories = $this->dao->select('*')->from(TABLE_REPOHISTORY)->where('commit')->eq($history->commit - 1)->andWhere('repo')->eq($repoID)->orderBy('time_desc')->fetchAll(); + foreach($prevHistories as $prevHistory) + { + if($history->time > $prevHistory->time) + { + $oldRevision = $prevHistory->revision; + break; + } + } + $log[0]->commit = $history->commit; } if(empty($oldRevision)) $oldRevision = '^';