From 1002950f2a93d28b1c7ace3649df0c6bffc4c8eb Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Tue, 23 Aug 2022 15:55:38 -0400 Subject: [PATCH] Fixes stash parents --- src/plus/webviews/graph/graphWebview.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plus/webviews/graph/graphWebview.ts b/src/plus/webviews/graph/graphWebview.ts index 69fecd9..06d5e72 100644 --- a/src/plus/webviews/graph/graphWebview.ts +++ b/src/plus/webviews/graph/graphWebview.ts @@ -555,8 +555,10 @@ async function convertToRows( parents = commit.parents; // Remove the second parent, if existing, from each stash commit as it affects column processing - if (parents.length > 1 && stash) { - parents = [...parents].splice(1, 1); + if (stash && parents.length > 1) { + // Copy the array to avoid mutating the original + parents = [...parents]; + parents.splice(1, 1); } rows.push({