Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/plugins/gitextractor/gitextractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func main() {
// pkPass := cmd.Flags().StringP("privateKeyPassPhrase", "P", "", "passphrase for private key")
proxy := cmd.Flags().StringP("proxy", "x", "", "proxy")
useGoGit := cmd.Flags().BoolP("useGoGit", "g", false, "use go-git instead of libgit2")
skipCommitStat := cmd.Flags().BoolP("skipCommitStat", "S", true, "")
skipCommitStat := cmd.Flags().BoolP("skipCommitStat", "S", false, "")
skipCommitFiles := cmd.Flags().BoolP("skipCommitFiles", "F", true, "")
timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
_ = cmd.MarkFlagRequired("url")
Expand Down
7 changes: 7 additions & 0 deletions backend/plugins/gitextractor/parser/clone_gitcli.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ func (g *GitcliCloner) CloneRepo(ctx plugin.SubTaskContext, localDir string) err
}
return err
}
// deepen the commits by 1 more step to avoid https://github.com/apache/incubator-devlake/issues/7426
if since != nil {
cmd := exec.CommandContext(ctx.GetContext(), "git", "-C", localDir, "fetch", "--deepen=1")
if err := cmd.Run(); err != nil {
return errors.Default.Wrap(err, "failed to deepen the cloned repo")
}
}

// save state
if g.stateManager != nil {
Expand Down