Skip to content

Commit 5114131

Browse files
authored
Merge pull request finos#752 from finos/595-unable-to-push-a-new-branch-to-an-empty-repository
fix: set parent to zero commit SHA if no parent exists on push (finos#595)
2 parents 3ae282b + 9f7b1ea commit 5114131

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/proxy/processors/push-action/parsePush.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@ const getCommitData = (contents) => {
6565
.trim();
6666
console.log({ tree });
6767

68-
const parent = parts
69-
.find((t) => t.split(' ')[0] === 'parent')
70-
.replace('parent', '')
71-
.trim();
68+
const parentValue = parts.find((t) => t.split(' ')[0] === 'parent');
69+
console.log({ parentValue });
70+
71+
const parent = parentValue
72+
? parentValue.replace('parent', '').trim()
73+
: '0000000000000000000000000000000000000000';
7274
console.log({ parent });
7375

7476
const author = parts

0 commit comments

Comments
 (0)