Skip to content
This repository was archived by the owner on Apr 12, 2019. It is now read-only.

Commit 4573c63

Browse files
authored
Fix retrieve file last commit branchName (#98)
* fix retrieve file last commit branchName * fix test * fix the commit cache and git log with specify branch or commit * remove unused lock
1 parent 4768133 commit 4573c63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

commit_info.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func targetedSearch(state *getCommitsInfoState, done chan error) {
7979
done <- nil
8080
return
8181
}
82-
command := NewCommand("rev-list", "-1", "HEAD", "--", entryPath)
82+
command := NewCommand("rev-list", "-1", state.headCommit.ID.String(), "--", entryPath)
8383
output, err := command.RunInDir(state.headCommit.repo.Path)
8484
if err != nil {
8585
done <- err
@@ -192,7 +192,7 @@ func getCommitsInfo(state *getCommitsInfoState) error {
192192
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute)
193193
defer cancel()
194194

195-
args := []string{"log", getCommitsInfoPretty, "--name-status", "-c"}
195+
args := []string{"log", state.headCommit.ID.String(), getCommitsInfoPretty, "--name-status", "-c"}
196196
if len(state.treePath) > 0 {
197197
args = append(args, "--", state.treePath)
198198
}

0 commit comments

Comments
 (0)