Skip to content

git-sensor return panic when commit has large file #1184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks
nishant-d opened this issue Feb 3, 2022 · 1 comment · Fixed by devtron-labs/git-sensor#10
Closed
2 tasks

git-sensor return panic when commit has large file #1184

nishant-d opened this issue Feb 3, 2022 · 1 comment · Fixed by devtron-labs/git-sensor#10
Assignees
Labels
bug Something isn't working

Comments

@nishant-d
Copy link
Member

in case of large file(more than 10M) go-git is unable to calculate the diff and panics.

Checklist:

  • I've searched in the docs and FAQ for my answer
  • I've included steps to reproduce the bug.

Describe the bug

sergi/go-diff#89
in case of large file(more than 10M) go-git is unable to calculate the diff and panics.

To Reproduce

  1. push large file in git
  2. try to fetch git commit list for ci-trigger on UI
  3. it will throw error

snippet to reproduce

	dat, err := os.ReadFile("/large-file")
	if err != nil {
		panic(err)
	}
	data := string(dat)
	d := diff.DoWithTimeout("", data, time.Hour)
	fmt.Println(d)
@nishant-d nishant-d added the bug Something isn't working label Feb 3, 2022
@nishant-d
Copy link
Member Author

possible fix:

  1. upgrade go-git library
  2. stop gap solution: handle panic at call sight

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant