Bugzilla – Attachment 177970 Details for
Bug 39114
Auto-rebase script does not deal correctly with deleted files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39114: The auto-rebase script - Fix files removal
Bug-39114-The-auto-rebase-script---Fix-files-remov.patch (text/plain), 1.89 KB, created by
Jonathan Druart
on 2025-02-12 19:13:39 UTC
(
hide
)
Description:
Bug 39114: The auto-rebase script - Fix files removal
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-02-12 19:13:39 UTC
Size:
1.89 KB
patch
obsolete
>From fda8f0f8ad669b10a0a9fc5839d8fc877c949730 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 12 Feb 2025 19:11:14 +0000 >Subject: [PATCH] Bug 39114: The auto-rebase script - Fix files removal > >It's using `$git->rm($file)` but this does not work. > >Test plan: >git checkout HEAD~100 (so you are before 38664) >git rm mainpage.pl >edit C4/Auth.pm and make some changes >git commit -a --no-verify -m"Bug 12345: test" >then rebase your branch >Retrieve the auto_rebase.pl version from this patch and run it >perl auto_rebase.pl > >The resulted commit should not contain mainpage.pl >--- > misc/devel/auto_rebase.pl | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > >diff --git a/misc/devel/auto_rebase.pl b/misc/devel/auto_rebase.pl >index 3dd01c4d253..120306e0531 100755 >--- a/misc/devel/auto_rebase.pl >+++ b/misc/devel/auto_rebase.pl >@@ -152,19 +152,20 @@ FILE: while ( my ( $ii, $file ) = each @modified_files ) { > say BLUE sprintf "\t\tProcessing file %s... (%s/%s)", $file, $ii + 1, scalar @modified_files; > > # Retrieve the content of the file from this commit >- my @content = try { >+ my $file_was_deleted = 0; >+ my @content = try { > $git->RUN( "show", "$commit:$file" ); > } catch { > if ( $_->error =~ m{fatal: path '.*' exists on disk, but not in '$commit'} ) { > say BLUE "\t\t\tFile does not exist, removing..."; >- $git->rm($file); >+ $file_was_deleted = 1; > } else { > say RED "Something wrong happened when retrieving the file from the branch."; > exit 2; > } > }; > >- next unless @content; # We removed the file >+ next if !@content || $file_was_deleted; # We removed the file > > my $parent_directory = dirname($file); > unless ( -f $parent_directory ) { >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39114
:
177970
|
177986
|
177988
|
177989
|
178012
|
178035