mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	On windows set core.longpaths true (#8776)
This commit is contained in:
		@@ -8,6 +8,7 @@ package git
 | 
				
			|||||||
import (
 | 
					import (
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"os/exec"
 | 
						"os/exec"
 | 
				
			||||||
 | 
						"runtime"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -133,6 +134,13 @@ func Init() error {
 | 
				
			|||||||
			return fmt.Errorf("Failed to execute 'git config --global gc.writeCommitGraph true': %s", stderr)
 | 
								return fmt.Errorf("Failed to execute 'git config --global gc.writeCommitGraph true': %s", stderr)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if runtime.GOOS == "windows" {
 | 
				
			||||||
 | 
							if _, stderr, err := process.GetManager().Exec("git.Init(git config --global core.longpaths true)",
 | 
				
			||||||
 | 
								GitExecutable, "config", "--global", "core.longpaths", "true"); err != nil {
 | 
				
			||||||
 | 
								return fmt.Errorf("Failed to execute 'git config --global core.longpaths true': %s", stderr)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user