summaryrefslogtreecommitdiffstats
path: root/pkg/git/commit_list_builder.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2019-05-12 17:04:32 +1000
committerJesse Duffield <jessedduffield@gmail.com>2019-05-12 17:59:49 +1000
commitc61bfbdd4cd46243ef6663533e0c9db05dd1f7bd (patch)
treee9128ab7a1e590e636ef354338c6816f494c7c4e /pkg/git/commit_list_builder.go
parente38d9d5f226a22e5299b82fe9c4ea46b7f7db120 (diff)
Support opening lazygit in a submodulev0.8
Diffstat (limited to 'pkg/git/commit_list_builder.go')
-rw-r--r--pkg/git/commit_list_builder.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/git/commit_list_builder.go b/pkg/git/commit_list_builder.go
index 32116656d..f3ba685f6 100644
--- a/pkg/git/commit_list_builder.go
+++ b/pkg/git/commit_list_builder.go
@@ -123,7 +123,7 @@ func (c *CommitListBuilder) getRebasingCommits(rebaseMode string) ([]*commands.C
func (c *CommitListBuilder) getNormalRebasingCommits() ([]*commands.Commit, error) {
rewrittenCount := 0
- bytesContent, err := ioutil.ReadFile(".git/rebase-apply/rewritten")
+ bytesContent, err := ioutil.ReadFile(fmt.Sprintf("%s/rebase-apply/rewritten", c.GitCommand.DotGitDir))
if err == nil {
content := string(bytesContent)
rewrittenCount = len(strings.Split(content, "\n"))
@@ -131,7 +131,7 @@ func (c *CommitListBuilder) getNormalRebasingCommits() ([]*commands.Commit, erro
// we know we're rebasing, so lets get all the files whose names have numbers
commits := []*commands.Commit{}
- err = filepath.Walk(".git/rebase-apply", func(path string, f os.FileInfo, err error) error {
+ err = filepath.Walk(fmt.Sprintf("%s/rebase-apply", c.GitCommand.DotGitDir), func(path string, f os.FileInfo, err error) error {
if rewrittenCount > 0 {
rewrittenCount--
return nil
@@ -175,7 +175,7 @@ func (c *CommitListBuilder) getNormalRebasingCommits() ([]*commands.Commit, erro
// and extracts out the sha and names of commits that we still have to go
// in the rebase:
func (c *CommitListBuilder) getInteractiveRebasingCommits() ([]*commands.Commit, error) {
- bytesContent, err := ioutil.ReadFile(".git/rebase-merge/git-rebase-todo")
+ bytesContent, err := ioutil.ReadFile(fmt.Sprintf("%s/rebase-merge/git-rebase-todo", c.GitCommand.DotGitDir))
if err != nil {
c.Log.Info(fmt.Sprintf("error occured reading git-rebase-todo: %s", err.Error()))
// we assume an error means the file doesn't exist so we just return