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