ref #44776 Cater for the cases of multiple/no previous hashes

This commit is contained in:
Ryuichi Inagaki
2018-04-08 23:52:25 +10:00
parent 3fdf0bcc56
commit ac63779dca
2 changed files with 34 additions and 9 deletions

View File

@@ -1295,7 +1295,8 @@ export class Repository {
return Promise.reject<Commit>('bad commit format');
}
return { hash: match[1], message: match[3], previousHashes: [match[2]] };
const previousHashes = match[2] ? match[2].split(' ') : [];
return { hash: match[1], message: match[3], previousHashes };
}
async updateSubmodules(paths: string[]): Promise<void> {