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