File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -2313,10 +2313,24 @@ int git_config_get_virtualfilesystem(void)
23132313	if  (core_virtualfilesystem  &&  !* core_virtualfilesystem )
23142314		core_virtualfilesystem  =  NULL ;
23152315
2316- 	/* virtual file system relies on the sparse checkout logic so force it on */ 
23172316	if  (core_virtualfilesystem ) {
2318- 		core_apply_sparse_checkout  =  1 ;
2319- 		return  1 ;
2317+ 		/* 
2318+ 		 * Some git commands spawn helpers and redirect the index to a different 
2319+ 		 * location.  These include "difftool -d" and the sequencer 
2320+ 		 * (i.e. `git rebase -i`, `git cherry-pick` and `git revert`) and others. 
2321+ 		 * In those instances we don't want to update their temporary index with 
2322+ 		 * our virtualization data. 
2323+ 		 */ 
2324+ 		char  * default_index_file  =  xstrfmt ("%s/%s" , the_repository -> gitdir , "index" );
2325+ 		int  should_run_hook  =  !strcmp (default_index_file , the_repository -> index_file );
2326+ 
2327+ 		free (default_index_file );
2328+ 		if  (should_run_hook ) {
2329+ 			/* virtual file system relies on the sparse checkout logic so force it on */ 
2330+ 			core_apply_sparse_checkout  =  1 ;
2331+ 			return  1 ;
2332+ 		} 
2333+ 		core_virtualfilesystem  =  NULL ;
23202334	}
23212335
23222336	return  0 ;
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments