@@ -249,6 +249,7 @@ function pushWithToken(rootDir: string, branch: string, config: BumpyConfig): vo
249249 // Both must be cleared for our custom token to be used.
250250 const extraHeaderKey = `http.${ server } /.extraheader` ;
251251 const savedHeader = tryRunArgs ( [ 'git' , 'config' , '--local' , extraHeaderKey ] , { cwd : rootDir } ) ;
252+ log . dim ( ` extraheader present: ${ ! ! savedHeader } ` ) ;
252253
253254 // Collect includeIf entries that point to credential config files
254255 // git config --get-regexp outputs keys in lowercase, so match accordingly
@@ -264,14 +265,40 @@ function pushWithToken(rootDir: string, branch: string, config: BumpyConfig): vo
264265 }
265266 }
266267 }
268+ log . dim ( ` includeIf entries found: ${ savedIncludeIfs . length } ` ) ;
269+ for ( const entry of savedIncludeIfs ) {
270+ log . dim ( ` ${ entry . key } ` ) ;
271+ }
272+
273+ // Dump full git config for debugging
274+ const fullConfig = tryRunArgs ( [ 'git' , 'config' , '--local' , '--list' ] , { cwd : rootDir } ) ;
275+ if ( fullConfig ) {
276+ for ( const line of fullConfig . split ( '\n' ) ) {
277+ if ( / i n c l u d e i f | e x t r a h e a d e r / i. test ( line ) ) {
278+ log . dim ( ` [git config] ${ line } ` ) ;
279+ }
280+ }
281+ }
267282
268283 try {
269284 if ( savedHeader ) {
270285 runArgs ( [ 'git' , 'config' , '--local' , '--unset-all' , extraHeaderKey ] , { cwd : rootDir } ) ;
271286 }
272287 for ( const entry of savedIncludeIfs ) {
288+ log . dim ( ` Unsetting: ${ entry . key } ` ) ;
273289 tryRunArgs ( [ 'git' , 'config' , '--local' , '--unset' , entry . key ] , { cwd : rootDir } ) ;
274290 }
291+
292+ // Verify cleanup
293+ const remainingIncludeIf = tryRunArgs ( [ 'git' , 'config' , '--local' , '--get-regexp' , '^includeif\\.gitdir:' ] , {
294+ cwd : rootDir ,
295+ } ) ;
296+ if ( remainingIncludeIf ) {
297+ log . warn ( ` includeIf entries still present after cleanup:\n${ remainingIncludeIf } ` ) ;
298+ } else {
299+ log . dim ( ' All includeIf entries cleared' ) ;
300+ }
301+
275302 runArgs ( [ 'git' , 'remote' , 'set-url' , 'origin' , authedUrl ] , { cwd : rootDir } ) ;
276303 try {
277304 runArgs ( [ 'git' , 'push' , '-u' , 'origin' , branch , '--force' ] , { cwd : rootDir } ) ;
0 commit comments