libgit2 / libgit2/libgit2sharp

Push fails with "No error message has been provided by the native library" when trying to push large files

Abierto
#2,012 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
C#
Estrellas
3.5k
Forks
925
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

I am not able to push large files to origin with pre-release 0.27.0-preview-0182. The same code worked with latest stable release
Ending up with exception and message: "No error message has been provided by the native library"
Tried to push a new json file which is 18MB large.
I did not check what file size is the breaking point, but if needed can try to investigate that too.

Adding reproduction steps with snippets of my code, hope this is enough, otherwise please ask for more.

Reproduction steps
  1. Clone repository and create branch
Repository.Clone(githubRepoUrl, $"./{folderName}", 
  new CloneOptions { CredentialsProvider = _gitHubClientWrapper.CredentialsProvider() });

using (var repo = new Repository($"./{folderName}"))
{
  repo.CreateBranch(newBranchName);
}
  1. Create large file. I just generated a large list of objects serialized into json. Got around 18mb of json file.
  2. Commit and push the branch to origin
using (var repo = new Repository($"./{folderName}"))
{
	Branch branch = repo.Branches[newBranchName];
	Commands.Checkout(repo, branch);
	Commands.Stage(repo, "*");
	Signature committer = new Signature("Github bot", "@bot", DateTime.Now);

	try
	{
		repo.Commit("Comit message", committer, committer);
		Remote remote = repo.Network.Remotes["origin"];
		repo.Branches.Update(branch, b => b.Remote = remote.Name, b => b.UpstreamBranch = branch.CanonicalName);
		repo.Network.Push(branch, new PushOptions
		{
			CredentialsProvider = _gitHubClientWrapper.CredentialsProvider(),
		});

	}
	catch (EmptyCommitException)
	{
		_logger.LogInformation("There's nothing to commit.");
		return;
	}
}
Expected behavior

Push is successful.

Actual behavior

Push fails with exception and message "No error message has been provided by the native library"

Version of LibGit2Sharp (release number or SHA1)

0.27.0-preview-0182

Operating system(s) tested; .NET runtime tested

Windows11, .NET 7

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Reproduce el fallo clonando un repositorio, creando un archivo JSON de aproximadamente 18 MB, haciendo commit de este y llamando a repo.Network.Push con las PushOptions mostradas en 0.27.0-preview-0182; compara los mismos pasos con la versión estable más reciente. Sigue los puntos de entrada de Repository y repo.Network.Push y determina si la regresión está en el manejo del push o en la notificación de errores nativos; se considera terminado cuando el push del archivo grande se realiza correctamente o informa de un error útil y accionable.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
csharp, git
Área
devtools
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.