func fixHookFunc(hooksDir string, hookNames map[string]bool) filepath.WalkFunc {
	return func(path string, info os.FileInfo, err error) error {
		if err != nil {
			return err
		}
		mode := info.Mode()
		if path != hooksDir && mode.IsDir() {
			return filepath.SkipDir
		}
		if name := filepath.Base(path); hookNames[name] {
			if mode&0100 == 0 {
				return os.Chmod(path, mode|0100)
			}
		}
		return nil
	}
}
// fixHookFunc returns a WalkFunc that makes sure hooks are owner-executable.
fixHookFunc returns a WalkFunc that makes sure hooks are owner-executable.
// fixHookFunc returns a WalkFunc that makes sure hooks are owner - executable .
func fixHookFunc(hooksDir string, hookNames map[string]bool) filepath.WalkFunc {
	return func(path string, info os.FileInfo, err error) error {
		if err != nil {
			return err
		}
		mode := info.Mode()
		if path != hooksDir && mode.IsDir() {
			return filepath.SkipDir
		}
		if name := filepath.Base(path); hookNames[name] {
			if mode&0100 == 0 {
				return os.Chmod(path, mode|0100)
			}
		}
		return nil
	}
}
func fixHookFunc ( hooksDir string , hookNames map [ string ] bool ) filepath . WalkFunc { return func ( path string , info os . FileInfo , err error ) error { if err != nil { return err } mode := info . Mode ( ) if path != hooksDir && mode . IsDir ( ) { return filepath . SkipDir } if name := filepath . Base ( path ) ; hookNames [ name ] { if mode & 0100 == 0 { return os . Chmod ( path , mode | 0100 ) } } return nil } }
fixHookFunc returns a WalkFunc that makes sure hooks are owner-executable.
fixHookFunc returns a WalkFunc that makes sure hooks are owner - executable .