From 81546fb35532e18e2d5560f3c381b6a07f72c2cc Mon Sep 17 00:00:00 2001 From: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com> Date: Fri, 15 Dec 2023 14:39:46 +0100 Subject: [PATCH] Git - only add --diff-merges if flag is supported (#200954) --- extensions/git/src/git.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts index 648b8e4421a..7e6052a1765 100644 --- a/extensions/git/src/git.ts +++ b/extensions/git/src/git.ts @@ -1049,7 +1049,11 @@ export class Repository { const args = ['log', `--format=${COMMIT_FORMAT}`, '-z']; if (options?.shortStats) { - args.push('--shortstat', '--diff-merges=first-parent'); + args.push('--shortstat'); + + if (this._git.compareGitVersionTo('2.31') !== -1) { + args.push('--diff-merges=first-parent'); + } } if (options?.reverse) {