mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-14 10:52:41 +01:00
1c63ac6a3a
Summary: Ref T9028. This allows us to detect when commits are unreachable: - When a ref (tag, branch, etc) is moved or deleted, store the old thing it pointed at in a list. - After discovery, go through the list and check if all the stuff on it is still reachable. - If something isn't, try to follow its ancestors back until we find something that is reachable. - Then, mark everything we found as unreachable. - Finally, rebuild the repository summary table to correct the commit count. Test Plan: - Deleted a ref, ran `pull` + `refs`, saw oldref in database. - Ran `discover`, saw it process the oldref, mark the unreachable commit, and update the summary table. - Visited commit page, saw it properly marked. Reviewers: chad Reviewed By: chad Maniphest Tasks: T9028 Differential Revision: https://secure.phabricator.com/D16133
6 lines
300 B
SQL
6 lines
300 B
SQL
CREATE TABLE {$NAMESPACE}_repository.repository_oldref (
|
|
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
|
repositoryPHID VARBINARY(64) NOT NULL,
|
|
commitIdentifier VARCHAR(40) NOT NULL COLLATE {$COLLATE_TEXT},
|
|
KEY `key_repository` (repositoryPHID)
|
|
) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
|