diff mbox series

bin/git-make-shallow: Fix syntax to work with older git versions

Message ID 20250110090955.125297-1-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit 0723ec9d4cd7c9b2d46904c3a038be123feea374
Headers show
Series bin/git-make-shallow: Fix syntax to work with older git versions | expand

Commit Message

Richard Purdie Jan. 10, 2025, 9:09 a.m. UTC
The transaction model was only introduced in git 2.27 whereas Ubuntu focal
(20.04) has 2.25. This causes failures. We don't need the transations here
so simply drop the commit piece, fixing on older git versions.

Credit to Nick Owens <nick.owens@eero.com> for working out how to fix it.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 bin/git-make-shallow | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/bin/git-make-shallow b/bin/git-make-shallow
index 8ad704fae5..e6c180b4d6 100755
--- a/bin/git-make-shallow
+++ b/bin/git-make-shallow
@@ -116,7 +116,7 @@  def filter_refs(refs):
     to_remove = set(all_refs) - set(refs)
     if to_remove:
         check_output(git_cmd + ['update-ref', '--no-deref', '--stdin', '-z'],
-                     input=''.join('delete ' + l + '\0\0' for l in to_remove) + 'commit\0')
+                     input=''.join('delete ' + l + '\0\0' for l in to_remove))
 
 
 def follow_history_intersections(revisions, refs):