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