File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed
Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -538,6 +538,20 @@ static void check_non_tip(void)
538538 }
539539}
540540
541+ static void send_shallow (struct commit_list * result )
542+ {
543+ while (result ) {
544+ struct object * object = & result -> item -> object ;
545+ if (!(object -> flags & (CLIENT_SHALLOW |NOT_SHALLOW ))) {
546+ packet_write (1 , "shallow %s" ,
547+ oid_to_hex (& object -> oid ));
548+ register_shallow (object -> oid .hash );
549+ shallow_nr ++ ;
550+ }
551+ result = result -> next ;
552+ }
553+ }
554+
541555static void deepen (int depth , const struct object_array * shallows )
542556{
543557 struct commit_list * result = NULL , * backup = NULL ;
@@ -551,16 +565,7 @@ static void deepen(int depth, const struct object_array *shallows)
551565 backup = result =
552566 get_shallow_commits (& want_obj , depth ,
553567 SHALLOW , NOT_SHALLOW );
554- while (result ) {
555- struct object * object = & result -> item -> object ;
556- if (!(object -> flags & (CLIENT_SHALLOW |NOT_SHALLOW ))) {
557- packet_write (1 , "shallow %s" ,
558- oid_to_hex (& object -> oid ));
559- register_shallow (object -> oid .hash );
560- shallow_nr ++ ;
561- }
562- result = result -> next ;
563- }
568+ send_shallow (result );
564569 free_commit_list (backup );
565570 for (i = 0 ; i < shallows -> nr ; i ++ ) {
566571 struct object * object = shallows -> objects [i ].item ;
You can’t perform that action at this time.
0 commit comments