Skip to content

[Step-2142] Git command#218

Open
tothszabi wants to merge 2 commits intomasterfrom
STEP-2142-git-command
Open

[Step-2142] Git command#218
tothszabi wants to merge 2 commits intomasterfrom
STEP-2142-git-command

Conversation

@tothszabi
Copy link
Contributor

New git commands.

@tothszabi tothszabi force-pushed the STEP-2142-git-command branch from efab978 to 9f17051 Compare February 2, 2026 20:54
@tothszabi tothszabi force-pushed the STEP-2142-git-command branch from 9f17051 to b1eaaa8 Compare February 3, 2026 16:11
@tothszabi tothszabi marked this pull request as ready for review February 3, 2026 16:17
Comment on lines +117 to +160
func (f *factory) SparseCheckoutInit(cone bool) Template {
args := []string{"sparse-checkout", "init"}
if cone {
args = append(args, "--cone")
}
return f.template(args...)
}

// Config ...
func (f *factory) Config(key string, value string, opts ...string) Template {
args := []string{"config", key, value}
args = append(args, opts...)
return f.template(args...)
}

// UpdateRef ...
func (f *factory) UpdateRef(opts ...string) Template {
args := append([]string{"update-ref"}, opts...)
return f.template(args...)
}

// RevParse ...
func (f *factory) RevParse(arg string) Template {
return f.template("rev-parse", arg)
}

// RevList ...
func (f *factory) RevList(commit string, opts ...string) Template {
args := []string{"rev-list", commit}
args = append(args, opts...)
return f.template(args...)
}

// Log ...
func (f *factory) Log(format string, opts ...string) Template {
args := []string{"log", "-1", "--format=" + format}
args = append(args, opts...)
return f.template(args...)
}

// SubmoduleForeach ...
func (f *factory) SubmoduleForeach(action Template) Template {
args := []string{"submodule", "foreach"}
if t, ok := action.(*template); ok {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if this type assertion fails then the function just runs git submodule foreach with no args?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving so you can merge. Up to you if you want to follow on with a PR to prevent this in the future. Or maybe we can be confident that it'll always be type template

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants