diff --git a/__test__/entrypoint.sh b/__test__/entrypoint.sh
index 62180bf..52fcc11 100755
--- a/__test__/entrypoint.sh
+++ b/__test__/entrypoint.sh
@@ -22,6 +22,7 @@ git config --global user.name "Your Name"
 echo "#test-base" > README.md
 git add .
 git commit -m "initial commit"
+git commit --allow-empty -m "empty commit for tests"
 echo "#test-base :sparkles:" > README.md
 git add .
 git commit -m "add sparkles" -m "Change description:
diff --git a/__test__/git-command-manager.int.test.ts b/__test__/git-command-manager.int.test.ts
index c52fcdb..0eec4a9 100644
--- a/__test__/git-command-manager.int.test.ts
+++ b/__test__/git-command-manager.int.test.ts
@@ -11,17 +11,26 @@ describe('git-command-manager integration tests', () => {
   })
 
   it('tests getCommit', async () => {
-    const parent = await git.getCommit('HEAD^')
-    const commit = await git.getCommit('HEAD')
-    expect(parent.subject).toEqual('initial commit')
-    expect(parent.signed).toBeFalsy()
-    expect(parent.changes).toEqual([
+    const initialCommit = await git.getCommit('HEAD^^')
+    const emptyCommit = await git.getCommit('HEAD^')
+    const headCommit = await git.getCommit('HEAD')
+
+    expect(initialCommit.subject).toEqual('initial commit')
+    expect(initialCommit.signed).toBeFalsy()
+    expect(initialCommit.changes).toEqual([
       {mode: '100644', status: 'A', path: 'README.md'}
     ])
-    expect(commit.subject).toEqual('add sparkles')
-    expect(commit.parents[0]).toEqual(parent.sha)
-    expect(commit.signed).toBeFalsy()
-    expect(commit.changes).toEqual([
+
+    expect(emptyCommit.subject).toEqual('empty commit for tests')
+    expect(emptyCommit.tree).toEqual(initialCommit.tree) // empty commits have no tree and reference the parent's
+    expect(emptyCommit.parents[0]).toEqual(initialCommit.sha)
+    expect(emptyCommit.signed).toBeFalsy()
+    expect(emptyCommit.changes).toEqual([])
+
+    expect(headCommit.subject).toEqual('add sparkles')
+    expect(headCommit.parents[0]).toEqual(emptyCommit.sha)
+    expect(headCommit.signed).toBeFalsy()
+    expect(headCommit.changes).toEqual([
       {mode: '100644', status: 'M', path: 'README.md'}
     ])
   })
diff --git a/dist/index.js b/dist/index.js
index 40c1d1d..82e76d5 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -93,6 +93,9 @@ function buildBranchCommits(git, base, branch) {
         for (const sha of shas) {
             const commit = yield git.getCommit(sha);
             commits.push(commit);
+            for (const unparsedChange of commit.unparsedChanges) {
+                core.warning(`Skipping unexpected diff entry: ${unparsedChange}`);
+            }
         }
         return commits;
     });
@@ -715,13 +718,13 @@ class GitCommandManager {
                 'show',
                 '--raw',
                 '--cc',
-                '--diff-filter=AMD',
                 `--format=%H%n%T%n%P%n%G?%n%s%n%b%n${endOfBody}`,
                 ref
             ]);
             const lines = output.stdout.split('\n');
             const endOfBodyIndex = lines.lastIndexOf(endOfBody);
             const detailLines = lines.slice(0, endOfBodyIndex);
+            const unparsedChanges = [];
             return {
                 sha: detailLines[0],
                 tree: detailLines[1],
@@ -739,9 +742,10 @@ class GitCommandManager {
                         };
                     }
                     else {
-                        throw new Error(`Unexpected line format: ${line}`);
+                        unparsedChanges.push(line);
                     }
-                })
+                }),
+                unparsedChanges: unparsedChanges
             };
         });
     }
@@ -33504,9 +33508,23 @@ const kWeight = Symbol('kWeight')
 const kMaxWeightPerServer = Symbol('kMaxWeightPerServer')
 const kErrorPenalty = Symbol('kErrorPenalty')
 
+/**
+ * Calculate the greatest common divisor of two numbers by
+ * using the Euclidean algorithm.
+ *
+ * @param {number} a
+ * @param {number} b
+ * @returns {number}
+ */
 function getGreatestCommonDivisor (a, b) {
-  if (b === 0) return a
-  return getGreatestCommonDivisor(b, a % b)
+  if (a === 0) return b
+
+  while (b !== 0) {
+    const t = b
+    b = a % b
+    a = t
+  }
+  return a
 }
 
 function defaultFactory (origin, opts) {
@@ -33584,7 +33602,12 @@ class BalancedPool extends PoolBase {
   }
 
   _updateBalancedPoolStats () {
-    this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0)
+    let result = 0
+    for (let i = 0; i < this[kClients].length; i++) {
+      result = getGreatestCommonDivisor(this[kClients][i][kWeight], result)
+    }
+
+    this[kGreatestCommonDivisor] = result
   }
 
   removeUpstream (upstream) {
@@ -42771,12 +42794,25 @@ const { kState } = __nccwpck_require__(749)
 const { webidl } = __nccwpck_require__(4890)
 const { Blob } = __nccwpck_require__(2254)
 const assert = __nccwpck_require__(8061)
-const { isErrored } = __nccwpck_require__(3983)
+const { isErrored, isDisturbed } = __nccwpck_require__(4492)
 const { isArrayBuffer } = __nccwpck_require__(3746)
 const { serializeAMimeType } = __nccwpck_require__(7704)
 const { multipartFormDataParser } = __nccwpck_require__(7991)
 
 const textEncoder = new TextEncoder()
+function noop () {}
+
+const hasFinalizationRegistry = globalThis.FinalizationRegistry && process.version.indexOf('v18') !== 0
+let streamRegistry
+
+if (hasFinalizationRegistry) {
+  streamRegistry = new FinalizationRegistry((weakRef) => {
+    const stream = weakRef.deref()
+    if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) {
+      stream.cancel('Response object has been garbage collected').catch(noop)
+    }
+  })
+}
 
 // https://fetch.spec.whatwg.org/#concept-bodyinit-extract
 function extractBody (object, keepalive = false) {
@@ -43019,7 +43055,7 @@ function safelyExtractBody (object, keepalive = false) {
   return extractBody(object, keepalive)
 }
 
-function cloneBody (body) {
+function cloneBody (instance, body) {
   // To clone a body body, run these steps:
 
   // https://fetch.spec.whatwg.org/#concept-body-clone
@@ -43027,6 +43063,10 @@ function cloneBody (body) {
   // 1. Let « out1, out2 » be the result of teeing body’s stream.
   const [out1, out2] = body.stream.tee()
 
+  if (hasFinalizationRegistry) {
+    streamRegistry.register(instance, new WeakRef(out1))
+  }
+
   // 2. Set body’s stream to out1.
   body.stream = out1
 
@@ -43169,7 +43209,7 @@ async function consumeBody (object, convertBytesToJSValue, instance) {
 
   // 1. If object is unusable, then return a promise rejected
   //    with a TypeError.
-  if (bodyUnusable(object[kState].body)) {
+  if (bodyUnusable(object)) {
     throw new TypeError('Body is unusable: Body has already been read')
   }
 
@@ -43209,7 +43249,9 @@ async function consumeBody (object, convertBytesToJSValue, instance) {
 }
 
 // https://fetch.spec.whatwg.org/#body-unusable
-function bodyUnusable (body) {
+function bodyUnusable (object) {
+  const body = object[kState].body
+
   // An object including the Body interface mixin is
   // said to be unusable if its body is non-null and
   // its body’s stream is disturbed or locked.
@@ -43251,7 +43293,10 @@ module.exports = {
   extractBody,
   safelyExtractBody,
   cloneBody,
-  mixinBody
+  mixinBody,
+  streamRegistry,
+  hasFinalizationRegistry,
+  bodyUnusable
 }
 
 
@@ -48061,7 +48106,7 @@ module.exports = {
 
 
 
-const { extractBody, mixinBody, cloneBody } = __nccwpck_require__(6682)
+const { extractBody, mixinBody, cloneBody, bodyUnusable } = __nccwpck_require__(6682)
 const { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = __nccwpck_require__(2991)
 const { FinalizationRegistry } = __nccwpck_require__(1922)()
 const util = __nccwpck_require__(3983)
@@ -48616,7 +48661,7 @@ class Request {
     // 40. If initBody is null and inputBody is non-null, then:
     if (initBody == null && inputBody != null) {
       // 1. If input is unusable, then throw a TypeError.
-      if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) {
+      if (bodyUnusable(input)) {
         throw new TypeError(
           'Cannot construct a Request with a Request object that has already been used.'
         )
@@ -48818,7 +48863,7 @@ class Request {
     webidl.brandCheck(this, Request)
 
     // 1. If this is unusable, then throw a TypeError.
-    if (this.bodyUsed || this.body?.locked) {
+    if (bodyUnusable(this)) {
       throw new TypeError('unusable')
     }
 
@@ -48936,7 +48981,7 @@ function cloneRequest (request) {
   // 2. If request’s body is non-null, set newRequest’s body to the
   // result of cloning request’s body.
   if (request.body != null) {
-    newRequest.body = cloneBody(request.body)
+    newRequest.body = cloneBody(newRequest, request.body)
   }
 
   // 3. Return newRequest.
@@ -49104,7 +49149,7 @@ module.exports = { Request, makeRequest, fromInnerRequest, cloneRequest }
 
 
 const { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = __nccwpck_require__(2991)
-const { extractBody, cloneBody, mixinBody } = __nccwpck_require__(6682)
+const { extractBody, cloneBody, mixinBody, hasFinalizationRegistry, streamRegistry, bodyUnusable } = __nccwpck_require__(6682)
 const util = __nccwpck_require__(3983)
 const nodeUtil = __nccwpck_require__(7261)
 const { kEnumerableProperty } = util
@@ -49129,24 +49174,9 @@ const { URLSerializer } = __nccwpck_require__(7704)
 const { kConstruct } = __nccwpck_require__(2785)
 const assert = __nccwpck_require__(8061)
 const { types } = __nccwpck_require__(7261)
-const { isDisturbed, isErrored } = __nccwpck_require__(4492)
 
 const textEncoder = new TextEncoder('utf-8')
 
-const hasFinalizationRegistry = globalThis.FinalizationRegistry && process.version.indexOf('v18') !== 0
-let registry
-
-if (hasFinalizationRegistry) {
-  registry = new FinalizationRegistry((weakRef) => {
-    const stream = weakRef.deref()
-    if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) {
-      stream.cancel('Response object has been garbage collected').catch(noop)
-    }
-  })
-}
-
-function noop () {}
-
 // https://fetch.spec.whatwg.org/#response-class
 class Response {
   // Creates network error Response.
@@ -49347,7 +49377,7 @@ class Response {
     webidl.brandCheck(this, Response)
 
     // 1. If this is unusable, then throw a TypeError.
-    if (this.bodyUsed || this.body?.locked) {
+    if (bodyUnusable(this)) {
       throw webidl.errors.exception({
         header: 'Response.clone',
         message: 'Body has already been consumed.'
@@ -49430,7 +49460,7 @@ function cloneResponse (response) {
   // 3. If response’s body is non-null, then set newResponse’s body to the
   // result of cloning response’s body.
   if (response.body != null) {
-    newResponse.body = cloneBody(response.body)
+    newResponse.body = cloneBody(newResponse, response.body)
   }
 
   // 4. Return newResponse.
@@ -49635,7 +49665,7 @@ function fromInnerResponse (innerResponse, guard) {
     // a primitive or an object, even undefined. If the held value is an object, the registry keeps
     // a strong reference to it (so it can pass it to the cleanup callback later). Reworded from
     // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry
-    registry.register(response, new WeakRef(innerResponse.body.stream))
+    streamRegistry.register(response, new WeakRef(innerResponse.body.stream))
   }
 
   return response
diff --git a/src/create-or-update-branch.ts b/src/create-or-update-branch.ts
index 10f8bd5..c6eb073 100644
--- a/src/create-or-update-branch.ts
+++ b/src/create-or-update-branch.ts
@@ -61,6 +61,9 @@ export async function buildBranchCommits(
   for (const sha of shas) {
     const commit = await git.getCommit(sha)
     commits.push(commit)
+    for (const unparsedChange of commit.unparsedChanges) {
+      core.warning(`Skipping unexpected diff entry: ${unparsedChange}`)
+    }
   }
   return commits
 }
diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts
index 73661f7..b84c613 100644
--- a/src/git-command-manager.ts
+++ b/src/git-command-manager.ts
@@ -17,6 +17,7 @@ export type Commit = {
     status: 'A' | 'M' | 'D'
     path: string
   }[]
+  unparsedChanges: string[]
 }
 
 export class GitCommandManager {
@@ -158,7 +159,6 @@ export class GitCommandManager {
       'show',
       '--raw',
       '--cc',
-      '--diff-filter=AMD',
       `--format=%H%n%T%n%P%n%G?%n%s%n%b%n${endOfBody}`,
       ref
     ])
@@ -166,6 +166,7 @@ export class GitCommandManager {
     const endOfBodyIndex = lines.lastIndexOf(endOfBody)
     const detailLines = lines.slice(0, endOfBodyIndex)
 
+    const unparsedChanges: string[] = []
     return <Commit>{
       sha: detailLines[0],
       tree: detailLines[1],
@@ -184,9 +185,10 @@ export class GitCommandManager {
             path: change[4]
           }
         } else {
-          throw new Error(`Unexpected line format: ${line}`)
+          unparsedChanges.push(line)
         }
-      })
+      }),
+      unparsedChanges: unparsedChanges
     }
   }