зеркало из https://github.com/go-gitea/git.git
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
This commit is contained in:
Родитель
4768133d10
Коммит
4573c63ec9
|
@ -79,7 +79,7 @@ func targetedSearch(state *getCommitsInfoState, done chan error) {
|
||||||
done <- nil
|
done <- nil
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
command := NewCommand("rev-list", "-1", "HEAD", "--", entryPath)
|
command := NewCommand("rev-list", "-1", state.headCommit.ID.String(), "--", entryPath)
|
||||||
output, err := command.RunInDir(state.headCommit.repo.Path)
|
output, err := command.RunInDir(state.headCommit.repo.Path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
done <- err
|
done <- err
|
||||||
|
@ -192,7 +192,7 @@ func getCommitsInfo(state *getCommitsInfoState) error {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute)
|
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
args := []string{"log", getCommitsInfoPretty, "--name-status", "-c"}
|
args := []string{"log", state.headCommit.ID.String(), getCommitsInfoPretty, "--name-status", "-c"}
|
||||||
if len(state.treePath) > 0 {
|
if len(state.treePath) > 0 {
|
||||||
args = append(args, "--", state.treePath)
|
args = append(args, "--", state.treePath)
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче