@@ -156,15 +156,8 @@ static void create_pack_file(void)
156
156
const char * argv [10 ];
157
157
int arg = 0 ;
158
158
159
- if (shallow_nr ) {
160
- memset (& rev_list , 0 , sizeof (rev_list ));
161
- rev_list .proc = do_rev_list ;
162
- rev_list .out = -1 ;
163
- if (start_async (& rev_list ))
164
- die ("git upload-pack: unable to fork git-rev-list" );
165
- argv [arg ++ ] = "pack-objects" ;
166
- } else {
167
- argv [arg ++ ] = "pack-objects" ;
159
+ argv [arg ++ ] = "pack-objects" ;
160
+ if (!shallow_nr ) {
168
161
argv [arg ++ ] = "--revs" ;
169
162
if (create_full_pack )
170
163
argv [arg ++ ] = "--all" ;
@@ -182,7 +175,7 @@ static void create_pack_file(void)
182
175
argv [arg ++ ] = NULL ;
183
176
184
177
memset (& pack_objects , 0 , sizeof (pack_objects ));
185
- pack_objects .in = shallow_nr ? rev_list . out : -1 ;
178
+ pack_objects .in = -1 ;
186
179
pack_objects .out = -1 ;
187
180
pack_objects .err = -1 ;
188
181
pack_objects .git_cmd = 1 ;
@@ -191,8 +184,14 @@ static void create_pack_file(void)
191
184
if (start_command (& pack_objects ))
192
185
die ("git upload-pack: unable to fork git-pack-objects" );
193
186
194
- /* pass on revisions we (don't) want */
195
- if (!shallow_nr ) {
187
+ if (shallow_nr ) {
188
+ memset (& rev_list , 0 , sizeof (rev_list ));
189
+ rev_list .proc = do_rev_list ;
190
+ rev_list .out = pack_objects .in ;
191
+ if (start_async (& rev_list ))
192
+ die ("git upload-pack: unable to fork git-rev-list" );
193
+ }
194
+ else {
196
195
FILE * pipe_fd = xfdopen (pack_objects .in , "w" );
197
196
if (!create_full_pack ) {
198
197
int i ;
0 commit comments