repo
stringlengths
6
47
file_url
stringlengths
77
269
file_path
stringlengths
5
186
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-07 08:35:43
2026-01-07 08:55:24
truncated
bool
2 classes
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/oscommands/os_default_test.go
pkg/commands/oscommands/os_default_test.go
//go:build !windows package oscommands import ( "testing" "github.com/go-errors/errors" "github.com/stretchr/testify/assert" ) func TestOSCommandRunWithOutput(t *testing.T) { type scenario struct { args []string test func(string, error) } scenarios := []scenario{ { []string{"echo", "-n", "123"}, ...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/oscommands/dummies.go
pkg/commands/oscommands/dummies.go
package oscommands import ( "github.com/jesseduffield/lazygit/pkg/common" "github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/utils" ) // NewDummyOSCommand creates a new dummy OSCommand for testing func NewDummyOSCommand() *OSCommand { osCmd := NewOSCommand(common.NewDummyCommon(),...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/oscommands/cmd_obj.go
pkg/commands/oscommands/cmd_obj.go
package oscommands import ( "os/exec" "strings" "github.com/jesseduffield/gocui" "github.com/samber/lo" "github.com/sasha-s/go-deadlock" ) // A command object is a general way to represent a command to be run on the // command line. type CmdObj struct { cmd *exec.Cmd runner ICmdObjRunner // see DontLog() ...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/oscommands/cmd_obj_runner_windows.go
pkg/commands/oscommands/cmd_obj_runner_windows.go
package oscommands import ( "os/exec" ) func (self *cmdObjRunner) getCmdHandlerPty(cmd *exec.Cmd) (*cmdHandler, error) { // We don't have PTY support on Windows yet, so we just return a non-PTY handler. return self.getCmdHandlerNonPty(cmd) }
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/oscommands/cmd_obj_test.go
pkg/commands/oscommands/cmd_obj_test.go
package oscommands import ( "os/exec" "testing" "github.com/jesseduffield/gocui" ) func TestCmdObjToString(t *testing.T) { quote := func(s string) string { return "\"" + s + "\"" } scenarios := []struct { cmdArgs []string expected string }{ { cmdArgs: []string{"git", "push", "myfile.txt"}, ex...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/oscommands/os_windows_test.go
pkg/commands/oscommands/os_windows_test.go
package oscommands import ( "testing" "github.com/go-errors/errors" "github.com/stretchr/testify/assert" ) // handling this in a separate file because str.ToArgv has different behaviour if we're on windows func TestOSCommandOpenFileWindows(t *testing.T) { type scenario struct { filename string runner *Fak...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/oscommands/os_test.go
pkg/commands/oscommands/os_test.go
package oscommands import ( "os" "path/filepath" "testing" "github.com/stretchr/testify/assert" ) func TestOSCommandRun(t *testing.T) { type scenario struct { args []string test func(error) } scenarios := []scenario{ { []string{"rmdir", "unexisting-folder"}, func(err error) { assert.Regexp(t,...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/oscommands/copy.go
pkg/commands/oscommands/copy.go
package oscommands import ( "errors" "io" "os" "path/filepath" ) /* MIT License * * Copyright (c) 2017 Roland Singer [roland.singer@desertbit.com] * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal ...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/oscommands/cmd_obj_runner_test.go
pkg/commands/oscommands/cmd_obj_runner_test.go
package oscommands import ( "strings" "testing" "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/utils" ) func getRunner() *cmdObjRunner { log := utils.NewDummyLog() return &cmdObjRunner{ log: log, guiIO: NewNullGuiIO(log), } } func toChanFn(f func(ct CredentialType) string) func(...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/oscommands/cmd_obj_builder.go
pkg/commands/oscommands/cmd_obj_builder.go
package oscommands import ( "fmt" "os" "os/exec" "strings" "github.com/mgutz/str" ) type ICmdObjBuilder interface { // NewFromArgs takes a slice of strings like []string{"git", "commit"} and returns a new command object. New(args []string) *CmdObj // NewShell takes a string like `git commit` and returns an e...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/oscommands/os_windows.go
pkg/commands/oscommands/os_windows.go
package oscommands import ( "fmt" "os" "os/exec" "path/filepath" ) func GetPlatform() *Platform { return &Platform{ OS: "windows", Shell: "cmd", ShellArg: "/c", } } func (c *OSCommand) UpdateWindowTitle() error { path, getWdErr := os.Getwd() if getWdErr != nil { return getWdErr } argString...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/oscommands/os_default_platform.go
pkg/commands/oscommands/os_default_platform.go
//go:build !windows package oscommands import ( "os" "os/exec" "runtime" "strings" "syscall" ) func GetPlatform() *Platform { shell := getUserShell() prefixForShellFunctionsFile := "" if strings.HasSuffix(shell, "bash") { prefixForShellFunctionsFile = "shopt -s expand_aliases\n" } return &Platform{ O...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/oscommands/os.go
pkg/commands/oscommands/os.go
package oscommands import ( "io" "os" "os/exec" "path/filepath" "strings" "sync" "github.com/go-errors/errors" "github.com/samber/lo" "github.com/atotto/clipboard" "github.com/jesseduffield/lazygit/pkg/common" "github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/utils" ) /...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/oscommands/cmd_obj_runner_default.go
pkg/commands/oscommands/cmd_obj_runner_default.go
//go:build !windows package oscommands import ( "os/exec" "github.com/creack/pty" ) // we define this separately for windows and non-windows given that windows does // not have great PTY support and we need a PTY to handle a credential request func (self *cmdObjRunner) getCmdHandlerPty(cmd *exec.Cmd) (*cmdHandler...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/patch/patch_test.go
pkg/commands/patch/patch_test.go
package patch import ( "testing" "github.com/stretchr/testify/assert" ) const simpleDiff = `diff --git a/filename b/filename index dcd3485..1ba5540 100644 --- a/filename +++ b/filename @@ -1,5 +1,5 @@ apple -orange +grape ... ... ... ` const addNewlineToEndOfFile = `diff --git a/filename b/filename index 80a7...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/patch/patch_builder.go
pkg/commands/patch/patch_builder.go
package patch import ( "sort" "strings" "github.com/jesseduffield/generics/maps" "github.com/samber/lo" "github.com/sirupsen/logrus" ) type PatchStatus int const ( // UNSELECTED is for when the commit file has not been added to the patch in any way UNSELECTED PatchStatus = iota // WHOLE is for when you want...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/patch/patch_line.go
pkg/commands/patch/patch_line.go
package patch import "github.com/samber/lo" type PatchLineKind int const ( PATCH_HEADER PatchLineKind = iota HUNK_HEADER ADDITION DELETION CONTEXT NEWLINE_MESSAGE ) type PatchLine struct { Kind PatchLineKind Content string // something like '+ hello' (note the first character is not removed) } func (sel...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/patch/format.go
pkg/commands/patch/format.go
package patch import ( "strings" "github.com/jesseduffield/generics/set" "github.com/jesseduffield/lazygit/pkg/gui/style" "github.com/jesseduffield/lazygit/pkg/theme" "github.com/samber/lo" ) type patchPresenter struct { patch *Patch // if true, all following fields are ignored plain bool // line indices f...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/patch/transform.go
pkg/commands/patch/transform.go
package patch import ( "strings" "github.com/samber/lo" ) type patchTransformer struct { patch *Patch opts TransformOpts } type TransformOpts struct { // Create a patch that will applied in reverse with `git apply --reverse`. // This affects how unselected lines are treated when only parts of a hunk // are ...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/patch/patch.go
pkg/commands/patch/patch.go
package patch import ( "github.com/samber/lo" ) type Patch struct { // header of the patch (split on newlines) e.g. // diff --git a/filename b/filename // index dcd3485..1ba5540 100644 // --- a/filename // +++ b/filename header []string // hunks of the patch hunks []*Hunk } // Returns a new patch with the s...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/patch/parse.go
pkg/commands/patch/parse.go
package patch import ( "regexp" "strings" "github.com/jesseduffield/lazygit/pkg/utils" ) var hunkHeaderRegexp = regexp.MustCompile(`(?m)^@@ -(\d+)[^\+]+\+(\d+)[^@]+@@(.*)$`) func Parse(patchStr string) *Patch { // ignore trailing newline. lines := strings.Split(strings.TrimSuffix(patchStr, "\n"), "\n") hunks...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/patch/hunk.go
pkg/commands/patch/hunk.go
package patch import "fmt" // Example hunk: // @@ -16,2 +14,3 @@ func (f *CommitFile) Description() string { // return f.Name // -} // + // +// test type Hunk struct { // the line number of the first line in the old file ('16' in the above example) oldStart int // the line number of the first line in the new fil...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/models/author.go
pkg/commands/models/author.go
package models import "fmt" // A commit author type Author struct { Name string Email string } func (self *Author) Combined() string { return fmt.Sprintf("%s <%s>", self.Name, self.Email) }
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/models/commit.go
pkg/commands/models/commit.go
package models import ( "fmt" "github.com/jesseduffield/lazygit/pkg/utils" "github.com/samber/lo" "github.com/stefanhaller/git-todo-parser/todo" ) // Special commit hash for empty tree object const EmptyTreeCommitHash = "4b825dc642cb6eb9a060e54bf8d69288fbee4904" type CommitStatus uint8 const ( StatusNone Comm...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/models/file.go
pkg/commands/models/file.go
package models import ( "github.com/jesseduffield/lazygit/pkg/i18n" "github.com/jesseduffield/lazygit/pkg/utils" "github.com/samber/lo" ) // File : A file from git status // duplicating this for now type File struct { Path string PreviousPath string HasStagedChanges bool Ha...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/models/remote.go
pkg/commands/models/remote.go
package models // Remote : A git remote type Remote struct { Name string Urls []string Branches []*RemoteBranch } func (r *Remote) RefName() string { return r.Name } func (r *Remote) ID() string { return r.RefName() } func (r *Remote) URN() string { return "remote-" + r.ID() } func (r *Remote) Descri...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/models/worktree.go
pkg/commands/models/worktree.go
package models // A git worktree type Worktree struct { // if false, this is a linked worktree IsMain bool // if true, this is the worktree that is currently checked out IsCurrent bool // path to the directory of the worktree i.e. the directory that contains all the user's files Path string // if true, the path...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/models/ref.go
pkg/commands/models/ref.go
package models type Ref interface { FullRefName() string RefName() string ShortRefName() string ParentRefName() string Description() string }
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/models/working_tree_state.go
pkg/commands/models/working_tree_state.go
package models import "github.com/jesseduffield/lazygit/pkg/i18n" // The state of the working tree. Several of these can be true at once. // In particular, the concrete multi-state combinations that can occur in // practice are Rebasing+CherryPicking, and Rebasing+Reverting. Theoretically, I // guess Rebasing+Merging...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/models/stash_entry.go
pkg/commands/models/stash_entry.go
package models import "fmt" // StashEntry : A git stash entry type StashEntry struct { Index int Recency string Name string Hash string } func (s *StashEntry) FullRefName() string { return "refs/" + s.RefName() } func (s *StashEntry) RefName() string { return fmt.Sprintf("stash@{%d}", s.Index) } func...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/models/commit_file.go
pkg/commands/models/commit_file.go
package models // CommitFile : A git commit file type CommitFile struct { Path string ChangeStatus string // e.g. 'A' for added or 'M' for modified. This is based on the result from git diff --name-status } func (f *CommitFile) ID() string { return f.Path } func (f *CommitFile) Description() string { return f.P...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/models/remote_branch.go
pkg/commands/models/remote_branch.go
package models // Remote Branch : A git remote branch type RemoteBranch struct { Name string RemoteName string } func (r *RemoteBranch) FullName() string { return r.RemoteName + "/" + r.Name } func (r *RemoteBranch) FullRefName() string { return "refs/remotes/" + r.FullName() } func (r *RemoteBranch) RefN...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/models/tag.go
pkg/commands/models/tag.go
package models // Tag : A git tag type Tag struct { Name string // this is either the first line of the message of an annotated tag, or the // first line of a commit message for a lightweight tag Message string } func (t *Tag) FullRefName() string { return "refs/tags/" + t.RefName() } func (t *Tag) RefName() st...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/models/branch.go
pkg/commands/models/branch.go
package models import ( "fmt" "sync/atomic" ) // Branch : A git branch // duplicating this for now type Branch struct { Name string // the displayname is something like '(HEAD detached at 123asdf)', whereas in that case the name would be '123asdf' DisplayName string // indicator of when the branch was last chec...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/models/submodule_config.go
pkg/commands/models/submodule_config.go
package models import "path/filepath" type SubmoduleConfig struct { Name string Path string Url string ParentModule *SubmoduleConfig // nil if top-level } func (r *SubmoduleConfig) FullName() string { if r.ParentModule != nil { return r.ParentModule.FullName() + "/" + r.Name } return r.Name } func (r *S...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/hosting_service/hosting_service.go
pkg/commands/hosting_service/hosting_service.go
package hosting_service import ( "net/url" "regexp" "strings" "github.com/go-errors/errors" "github.com/jesseduffield/lazygit/pkg/i18n" "github.com/jesseduffield/lazygit/pkg/utils" "github.com/samber/lo" "github.com/sirupsen/logrus" "golang.org/x/exp/slices" ) // This package is for handling logic specific...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/hosting_service/definitions.go
pkg/commands/hosting_service/definitions.go
package hosting_service // if you want to make a custom regex for a given service feel free to test it out // at https://regex101.com using the flavor Golang var defaultUrlRegexStrings = []string{ `^(?:https?|ssh)://[^/]+/(?P<owner>.*)/(?P<repo>.*?)(?:\.git)?$`, `^(.*?@)?.*:/*(?P<owner>.*)/(?P<repo>.*?)(?:\.git)?$`,...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/hosting_service/hosting_service_test.go
pkg/commands/hosting_service/hosting_service_test.go
package hosting_service import ( "testing" "github.com/jesseduffield/lazygit/pkg/fakes" "github.com/jesseduffield/lazygit/pkg/i18n" "github.com/stretchr/testify/assert" ) func TestGetPullRequestURL(t *testing.T) { type scenario struct { testName string from string to ...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/git_command_builder_test.go
pkg/commands/git_commands/git_command_builder_test.go
package git_commands import ( "testing" "github.com/stretchr/testify/assert" ) func TestGitCommandBuilder(t *testing.T) { scenarios := []struct { input []string expected []string }{ { input: NewGitCmd("push"). Arg("--force-with-lease"). Arg("--set-upstream"). Arg("origin"). Arg("maste...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/sync_test.go
pkg/commands/git_commands/sync_test.go
package git_commands import ( "testing" "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/stretchr/testify/assert" ) func TestSyncPush(t *testing.T) { type scenario struct { testName string opts PushOpts test func(*oscommands.CmdObj, error) } ...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/blame.go
pkg/commands/git_commands/blame.go
package git_commands import ( "fmt" ) type BlameCommands struct { *GitCommon } func NewBlameCommands(gitCommon *GitCommon) *BlameCommands { return &BlameCommands{ GitCommon: gitCommon, } } // Blame a range of lines. For each line, output the hash of the commit where // the line last changed, then a space, the...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/working_tree_test.go
pkg/commands/git_commands/working_tree_test.go
package git_commands import ( "testing" "github.com/go-errors/errors" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/config" "github.com/stretchr/testify/assert" ) func TestWorkingTreeStageFile(t *testing.T...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/commit_file_loader_test.go
pkg/commands/git_commands/commit_file_loader_test.go
package git_commands import ( "testing" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/stretchr/testify/assert" ) func TestGetCommitFilesFromFilenames(t *testing.T) { tests := []struct { testName string input string output []*models.CommitFile }{ { testName: "no files", in...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/commit_file_loader.go
pkg/commands/git_commands/commit_file_loader.go
package git_commands import ( "strings" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/common" "github.com/samber/lo" ) type CommitFileLoader struct { *common.Common cmd oscommands.ICmdObjBuilder } func N...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/repo_paths_test.go
pkg/commands/git_commands/repo_paths_test.go
package git_commands import ( "fmt" "runtime" "strings" "testing" "github.com/go-errors/errors" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/samber/lo" "github.com/stretchr/testify/assert" ) type ( argFn func() []string errFn func(getRevParseArgs argFn) error ) type Scenario stru...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/sync.go
pkg/commands/git_commands/sync.go
package git_commands import ( "fmt" "github.com/go-errors/errors" "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" ) type SyncCommands struct { *GitCommon } func NewSyncCommands(gitCommon *GitCommon) *SyncCommands { return &SyncCommands{ GitCommon: gitCommon, } } ...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/commit.go
pkg/commands/git_commands/commit.go
package git_commands import ( "fmt" "strings" "github.com/go-errors/errors" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" ) var ErrInvalidCommitIndex = errors.New("invalid commit index") type CommitCommands struct { *GitCommon } func NewCommitCommands(gitCommon *GitCommon) *CommitCommands { retu...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/file.go
pkg/commands/git_commands/file.go
package git_commands import ( "os" "strconv" "strings" "github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/utils" "github.com/samber/lo" ) type FileCommands struct { *GitCommon } func NewFileCommands(gitCommon *GitCommon) *FileCommands { return &FileCommands{ GitCommon: git...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/tag_loader.go
pkg/commands/git_commands/tag_loader.go
package git_commands import ( "regexp" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/common" "github.com/jesseduffield/lazygit/pkg/utils" "github.com/samber/lo" ) type TagLoader struct { *common.Common c...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/remote.go
pkg/commands/git_commands/remote.go
package git_commands import ( "fmt" "strings" "github.com/jesseduffield/gocui" "github.com/samber/lo" ) type RemoteCommands struct { *GitCommon } func NewRemoteCommands(gitCommon *GitCommon) *RemoteCommands { return &RemoteCommands{ GitCommon: gitCommon, } } func (self *RemoteCommands) AddRemote(name stri...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/worktree.go
pkg/commands/git_commands/worktree.go
package git_commands import ( "path/filepath" "github.com/jesseduffield/lazygit/pkg/commands/models" ) type WorktreeCommands struct { *GitCommon } func NewWorktreeCommands(gitCommon *GitCommon) *WorktreeCommands { return &WorktreeCommands{ GitCommon: gitCommon, } } type NewWorktreeOpts struct { // required...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/worktree_loader_test.go
pkg/commands/git_commands/worktree_loader_test.go
package git_commands import ( "testing" "github.com/go-errors/errors" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/spf13/afero" "github.com/stretchr/testify/assert" ) func TestGetWorktrees(t *testing.T) { type scenario struct { ...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/custom.go
pkg/commands/git_commands/custom.go
package git_commands import ( "fmt" "strings" "github.com/mgutz/str" ) type CustomCommands struct { *GitCommon } func NewCustomCommands(gitCommon *GitCommon) *CustomCommands { return &CustomCommands{ GitCommon: gitCommon, } } // Only to be used for the sake of running custom commands specified by the user....
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/status.go
pkg/commands/git_commands/status.go
package git_commands import ( "os" "path/filepath" "strings" "github.com/jesseduffield/lazygit/pkg/commands/models" ) type StatusCommands struct { *GitCommon } func NewStatusCommands( gitCommon *GitCommon, ) *StatusCommands { return &StatusCommands{ GitCommon: gitCommon, } } func (self *StatusCommands) W...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/reflog_commit_loader.go
pkg/commands/git_commands/reflog_commit_loader.go
package git_commands import ( "strconv" "strings" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/common" "github.com/jesseduffield/lazygit/pkg/utils" ) type ReflogCommitLoader struct { *common.Common cmd ...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/deps_test.go
pkg/commands/git_commands/deps_test.go
package git_commands import ( "os" "github.com/go-errors/errors" gogit "github.com/jesseduffield/go-git/v5" "github.com/jesseduffield/lazygit/pkg/commands/git_config" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/common" "github.com/jesseduffield/lazygit/pkg/c...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/branch_test.go
pkg/commands/git_commands/branch_test.go
package git_commands import ( "testing" "github.com/go-errors/errors" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/config" "github.com/stretchr/testify/assert" ) func TestBranchGetCommitDifferences(t *testing.T) { type scenario struct { testName st...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/commit_test.go
pkg/commands/git_commands/commit_test.go
package git_commands import ( "testing" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/config" "github.com/stretchr/testify/assert" ) func TestCommitRewordCommit(t *testing.T) { type scenario struct { testName string runner *oscommands.FakeCmdObjRunn...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/config.go
pkg/commands/git_commands/config.go
package git_commands import ( gogit "github.com/jesseduffield/go-git/v5" "github.com/jesseduffield/go-git/v5/config" "github.com/jesseduffield/lazygit/pkg/commands/git_config" "github.com/jesseduffield/lazygit/pkg/common" ) type ConfigCommands struct { *common.Common gitConfig git_config.IGitConfig repo ...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/stash_test.go
pkg/commands/git_commands/stash_test.go
package git_commands import ( "testing" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/config" "github.com/stretchr/testify/assert" ) func TestStashDrop(t *testing.T) { runner := oscommands.NewFakeRunner(t). ExpectGitArgs([]string{"stash", "drop", "refs/stash@...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/commit_loader_test.go
pkg/commands/git_commands/commit_loader_test.go
package git_commands import ( "path/filepath" "strings" "testing" "github.com/go-errors/errors" "github.com/jesseduffield/generics/set" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/common" "github.com/j...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/working_tree.go
pkg/commands/git_commands/working_tree.go
package git_commands import ( "fmt" "os" "path/filepath" "regexp" "strings" "github.com/go-errors/errors" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" ) type WorkingTreeCommands struct { *GitCommon submodule *SubmoduleCommands fileLoade...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/file_test.go
pkg/commands/git_commands/file_test.go
package git_commands import ( "testing" "github.com/jesseduffield/lazygit/pkg/commands/git_config" "github.com/jesseduffield/lazygit/pkg/config" "github.com/stretchr/testify/assert" ) func TestEditFilesCmd(t *testing.T) { type scenario struct { filenames []string osConfig config.OSConfig expect...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/stash_loader.go
pkg/commands/git_commands/stash_loader.go
package git_commands import ( "regexp" "strconv" "strings" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/common" "github.com/jesseduffield/lazygit/pkg/utils" "github.com/samber/lo" ) type StashLoader str...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/commit_loader.go
pkg/commands/git_commands/commit_loader.go
package git_commands import ( "bytes" "fmt" "os" "path/filepath" "regexp" "sort" "strconv" "strings" "sync" "github.com/jesseduffield/generics/set" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/commo...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/repo_paths.go
pkg/commands/git_commands/repo_paths.go
package git_commands import ( ioFs "io/fs" "os" "path/filepath" "strings" "github.com/go-errors/errors" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/utils" "github.com/spf13/afero" ) type RepoPaths struct { worktreePath string worktreeGitDirPath str...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/flow.go
pkg/commands/git_commands/flow.go
package git_commands import ( "regexp" "strings" "github.com/go-errors/errors" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" ) type FlowCommands struct { *GitCommon } func NewFlowCommands( gitCommon *GitCommon, ) *FlowCommands { return &FlowCommands{ GitCommon: gitCommon, } } func (self *Flo...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/rebase.go
pkg/commands/git_commands/rebase.go
package git_commands import ( "fmt" "path/filepath" "strings" "github.com/go-errors/errors" "github.com/jesseduffield/lazygit/pkg/app/daemon" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/utils" "github....
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/stash_loader_test.go
pkg/commands/git_commands/stash_loader_test.go
package git_commands import ( "fmt" "testing" "time" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/common" "github.com/stretchr/testify/assert" ) func TestGetStashEntries(t *testing.T) { type scenario st...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/reflog_commit_loader_test.go
pkg/commands/git_commands/reflog_commit_loader_test.go
package git_commands import ( "errors" "strings" "testing" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/common" "github.com/jesseduffield/lazygit/pkg/utils" "github.com/samber/lo" "github.com/sanity-io/...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/commit_loading_shared.go
pkg/commands/git_commands/commit_loading_shared.go
package git_commands import ( "strings" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/samber/lo" ) func loadCommits( cmd *oscommands.CmdObj, filterPath string, parseLogLine func(string) (*models.Commit, bool), ) ([]*models.Commit,...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/stash.go
pkg/commands/git_commands/stash.go
package git_commands import ( "fmt" "strings" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" ) type StashCommands struct { *GitCommon fileLoader *FileLoader workingTree *WorkingTreeCommands } func NewStashCommands( gitCommon *GitCommon, fileLoader *FileLoader, workingTree *WorkingTreeCommands,...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/tag.go
pkg/commands/git_commands/tag.go
package git_commands import ( "strings" "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" ) type TagCommands struct { *GitCommon } func NewTagCommands(gitCommon *GitCommon) *TagCommands { return &TagCommands{ GitCommon: gitCommon, } } func (self *TagCommands) Creat...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/version_test.go
pkg/commands/git_commands/version_test.go
package git_commands import ( "testing" "github.com/stretchr/testify/assert" ) func TestParseGitVersion(t *testing.T) { scenarios := []struct { input string expected GitVersion }{ { input: "git version 2.39.0", expected: GitVersion{Major: 2, Minor: 39, Patch: 0, Additional: ""}, }, { inp...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/rebase_test.go
pkg/commands/git_commands/rebase_test.go
package git_commands import ( "regexp" "strconv" "testing" "github.com/go-errors/errors" "github.com/jesseduffield/lazygit/pkg/app/daemon" "github.com/jesseduffield/lazygit/pkg/commands/git_config" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/diff.go
pkg/commands/git_commands/diff.go
package git_commands import ( "fmt" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" ) type DiffCommands struct { *GitCommon } func NewDiffCommands(gitCommon *GitCommon) *DiffCommands { return &DiffCommands{ GitCommon: gitCommon, } } // This is for generating diffs to be shown in the UI (e.g. rend...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/worktree_loader.go
pkg/commands/git_commands/worktree_loader.go
package git_commands import ( iofs "io/fs" "path/filepath" "strings" "sync" "github.com/go-errors/errors" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/utils" "github.com/samber/lo" "github.com/spf13/afero" ) type WorktreeLoader struct { *GitCommon } func New...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/main_branches.go
pkg/commands/git_commands/main_branches.go
package git_commands import ( "slices" "strings" "sync" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/common" "github.com/jesseduffield/lazygit/pkg/utils" "github.com/samber/lo" "github.com/sasha-s/go-deadlock" ) type MainBranches struct { c *common.Common ...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/branch.go
pkg/commands/git_commands/branch.go
package git_commands import ( "fmt" "strings" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/utils" "github.com/mgutz/str" "github.com/samber/lo" ) type BranchCommands struct { *GitCommon allBranchesLogC...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/branch_loader.go
pkg/commands/git_commands/branch_loader.go
package git_commands import ( "fmt" "regexp" "slices" "strconv" "strings" "time" "github.com/jesseduffield/generics/set" "github.com/jesseduffield/go-git/v5/config" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/la...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/version.go
pkg/commands/git_commands/version.go
package git_commands import ( "errors" "regexp" "strconv" "strings" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" ) type GitVersion struct { Major, Minor, Patch int Additional string } func GetGitVersion(osCommand *oscommands.OSCommand) (*GitVersion, error) { versionStr, _, err := osCo...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/file_loader.go
pkg/commands/git_commands/file_loader.go
package git_commands import ( "fmt" "path/filepath" "strconv" "strings" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" ) type FileLoaderConfig interface { GetShowUntrackedFiles() string } type FileLoader struct { *GitCommon cmd osco...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/file_loader_test.go
pkg/commands/git_commands/file_loader_test.go
package git_commands import ( "testing" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/config" "github.com/stretchr/testify/assert" ) func TestFileGetStatusFiles(t *testing.T) { type scenario struct { tes...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/branch_loader_test.go
pkg/commands/git_commands/branch_loader_test.go
package git_commands // "*|feat/detect-purge|origin/feat/detect-purge|[ahead 1]" import ( "strconv" "testing" "time" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/stretchr/testify/assert" ) func TestObtainBranch(t *testing.T) { type scenario struct { testName string inp...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/remote_loader.go
pkg/commands/git_commands/remote_loader.go
package git_commands import ( "fmt" "slices" "strings" "sync" gogit "github.com/jesseduffield/go-git/v5" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/common" "github.com/jesseduffield/lazygit/pkg/utils"...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/patch.go
pkg/commands/git_commands/patch.go
package git_commands import ( "fmt" "path/filepath" "time" "github.com/go-errors/errors" "github.com/jesseduffield/lazygit/pkg/app/daemon" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/patch" "github.com/stefanhaller/git-todo-parser/todo" ) type PatchCo...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/bisect.go
pkg/commands/git_commands/bisect.go
package git_commands import ( "os" "path/filepath" "strings" ) type BisectCommands struct { *GitCommon } func NewBisectCommands(gitCommon *GitCommon) *BisectCommands { return &BisectCommands{ GitCommon: gitCommon, } } // This command is pretty cheap to run so we're not storing the result anywhere. // But if...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/bisect_info.go
pkg/commands/git_commands/bisect_info.go
package git_commands import ( "github.com/jesseduffield/generics/maps" "github.com/samber/lo" "github.com/sirupsen/logrus" ) // although the typical terms in a git bisect are 'bad' and 'good', they're more // generally known as 'new' and 'old'. Semi-recently git allowed the user to define // their own terms e.g. w...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/flow_test.go
pkg/commands/git_commands/flow_test.go
package git_commands import ( "testing" "github.com/jesseduffield/lazygit/pkg/commands/git_config" "github.com/stretchr/testify/assert" ) func TestStartCmdObj(t *testing.T) { scenarios := []struct { testName string branchType string name string expected []string }{ { testName: "basic", ...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/git_command_builder.go
pkg/commands/git_commands/git_command_builder.go
package git_commands import ( "strings" ) // convenience struct for building git commands. Especially useful when // including conditional args type GitCommandBuilder struct { // command string args []string } func NewGitCmd(command string) *GitCommandBuilder { return &GitCommandBuilder{args: []string{command}} ...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/submodule.go
pkg/commands/git_commands/submodule.go
package git_commands import ( "bufio" "os" "path/filepath" "regexp" "strings" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" ) // .gitmodules looks like this: // [submodule "mysubmodule"] // path = blah/mysubmodule // url = git@github.com:...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/tag_loader_test.go
pkg/commands/git_commands/tag_loader_test.go
package git_commands import ( "testing" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/common" "github.com/stretchr/testify/assert" ) const tagsOutput = `tag1 this is my message tag2 tag3 this is my other me...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_commands/common.go
pkg/commands/git_commands/common.go
package git_commands import ( gogit "github.com/jesseduffield/go-git/v5" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/common" "github.com/jesseduffield/lazygit/pkg/config" ) type GitCommon struct { *common.Common version *GitVersion cmd oscommands...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_config/fake_git_config.go
pkg/commands/git_config/fake_git_config.go
package git_config type FakeGitConfig struct { mockResponses map[string]string } func NewFakeGitConfig(mockResponses map[string]string) *FakeGitConfig { return &FakeGitConfig{ mockResponses: mockResponses, } } func (self *FakeGitConfig) Get(key string) string { if self.mockResponses == nil { return "" } re...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_config/cached_git_config.go
pkg/commands/git_config/cached_git_config.go
package git_config import ( "os/exec" "strings" "sync" "github.com/sirupsen/logrus" ) type IGitConfig interface { // this is for when you want to pass 'mykey' (it calls `git config --get --null mykey` under the hood) Get(string) string // this is for when you want to pass '--local --get-regexp mykey' GetGene...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_config/cached_git_config_test.go
pkg/commands/git_config/cached_git_config_test.go
package git_config import ( "os/exec" "strings" "testing" "github.com/jesseduffield/lazygit/pkg/utils" "github.com/stretchr/testify/assert" ) func TestGetBool(t *testing.T) { type scenario struct { testName string mockResponses map[string]string expected bool } scenarios := []scenario{ { ...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/commands/git_config/get_key.go
pkg/commands/git_config/get_key.go
package git_config import ( "bytes" "errors" "fmt" "io" "os/exec" "strings" "syscall" ) // including license from https://github.com/tcnksm/go-gitconfig because this file is an adaptation of that repo's code // Copyright (c) 2014 tcnksm // MIT License // Permission is hereby granted, free of charge, to any p...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/snake/snake_test.go
pkg/snake/snake_test.go
package snake import ( "testing" "github.com/stretchr/testify/assert" ) func TestSnake(t *testing.T) { scenarios := []struct { state State expectedState State expectedAlive bool }{ { state: State{ snakePositions: []Position{{x: 5, y: 5}}, direction: Right, lastTickDirect...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/snake/snake.go
pkg/snake/snake.go
package snake import ( "math/rand" "time" "github.com/samber/lo" ) type Game struct { // width/height of the board width int height int // function for rendering the game. If alive is false, the cells are expected // to be ignored. render func(cells [][]CellType, alive bool) // closed when the game is e...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false
jesseduffield/lazygit
https://github.com/jesseduffield/lazygit/blob/80dd695d7a8d32714603f5a6307f26f589802b1d/pkg/i18n/i18n.go
pkg/i18n/i18n.go
package i18n import ( "embed" "encoding/json" "fmt" "io/fs" "slices" "strings" "dario.cat/mergo" "github.com/cloudfoundry/jibber_jabber" "github.com/go-errors/errors" "github.com/samber/lo" "github.com/sirupsen/logrus" ) func NewTranslationSetFromConfig(log *logrus.Entry, configLanguage string) (*Translat...
go
MIT
80dd695d7a8d32714603f5a6307f26f589802b1d
2026-01-07T08:35:43.445894Z
false