@@ -583,7 +583,6 @@ static int run_am(struct rebase_options *opts)
583
583
{
584
584
struct child_process am = CHILD_PROCESS_INIT ;
585
585
struct child_process format_patch = CHILD_PROCESS_INIT ;
586
- struct strbuf revisions = STRBUF_INIT ;
587
586
int status ;
588
587
char * rebased_patches ;
589
588
@@ -616,13 +615,6 @@ static int run_am(struct rebase_options *opts)
616
615
return run_command (& am );
617
616
}
618
617
619
- strbuf_addf (& revisions , "%s...%s" ,
620
- oid_to_hex (opts -> root ?
621
- /* this is now equivalent to !opts->upstream */
622
- & opts -> onto -> object .oid :
623
- & opts -> upstream -> object .oid ),
624
- oid_to_hex (& opts -> orig_head -> object .oid ));
625
-
626
618
rebased_patches = xstrdup (git_path ("rebased-patches" ));
627
619
format_patch .out = open (rebased_patches ,
628
620
O_WRONLY | O_CREAT | O_TRUNC , 0666 );
@@ -643,7 +635,12 @@ static int run_am(struct rebase_options *opts)
643
635
if (opts -> git_format_patch_opt .len )
644
636
strvec_split (& format_patch .args ,
645
637
opts -> git_format_patch_opt .buf );
646
- strvec_push (& format_patch .args , revisions .buf );
638
+ strvec_pushf (& format_patch .args , "%s...%s" ,
639
+ oid_to_hex (opts -> root ?
640
+ /* this is now equivalent to !opts->upstream */
641
+ & opts -> onto -> object .oid :
642
+ & opts -> upstream -> object .oid ),
643
+ oid_to_hex (& opts -> orig_head -> object .oid ));
647
644
if (opts -> restrict_revision )
648
645
strvec_pushf (& format_patch .args , "^%s" ,
649
646
oid_to_hex (& opts -> restrict_revision -> object .oid ));
@@ -666,10 +663,8 @@ static int run_am(struct rebase_options *opts)
666
663
"As a result, git cannot rebase them." ),
667
664
opts -> revisions );
668
665
669
- strbuf_release (& revisions );
670
666
return status ;
671
667
}
672
- strbuf_release (& revisions );
673
668
674
669
am .in = open (rebased_patches , O_RDONLY );
675
670
if (am .in < 0 ) {
0 commit comments