github.com/1800alex/go-git-cmd-wrapper@v1.1.0/init/init_gen.go (about) 1 package init 2 3 // CODE GENERATED AUTOMATICALLY 4 // THIS FILE MUST NOT BE EDITED BY HAND 5 6 import ( 7 "fmt" 8 9 "github.com/ldez/go-git-cmd-wrapper/types" 10 ) 11 12 // Bare Create a bare repository. 13 // If GIT_DIR environment is not set, it is set to the current working directory. 14 // --bare 15 func Bare(g *types.Cmd) { 16 g.AddOptions("--bare") 17 } 18 19 // Quiet Only print error and warning messages; all other output will be suppressed. 20 // -q, --quiet 21 func Quiet(g *types.Cmd) { 22 g.AddOptions("--quiet") 23 } 24 25 // SeparateGitDir Instead of initializing the repository as a directory to either $GIT_DIR or ./.git/, create a text file there containing the path to the actual repository. 26 // This file acts as filesystem-agnostic Git symbolic link to the repository. 27 // --separate-git-dir=<git dir> 28 func SeparateGitDir(gitDir string) func(*types.Cmd) { 29 return func(g *types.Cmd) { 30 g.AddOptions(fmt.Sprintf("--separate-git-dir=%s", gitDir)) 31 } 32 } 33 34 // Shared Specify that the Git repository is to be shared amongst several users. 35 // This allows users belonging to the same group to push into that repository. 36 // When specified, the config variable 'core.sharedRepository' is set so that files and directories under $GIT_DIR are created with the requested permissions. 37 // When not specified, Git will use permissions reported by umask(2). 38 // --shared[=(false|true|umask|group|all|world|everybody|0xxx)] 39 func Shared(value string) func(*types.Cmd) { 40 return func(g *types.Cmd) { 41 if len(value) == 0 { 42 g.AddOptions("--shared") 43 } else { 44 g.AddOptions(fmt.Sprintf("--shared=%s", value)) 45 } 46 } 47 } 48 49 // Template Specify the directory from which templates will be used. 50 // (See the 'TEMPLATE DIRECTORY' section below.) 51 // --template=<template_directory> 52 func Template(templateDirectory string) func(*types.Cmd) { 53 return func(g *types.Cmd) { 54 g.AddOptions(fmt.Sprintf("--template=%s", templateDirectory)) 55 } 56 }