libgit2 / libgit2/libgit2sharp
Repositories with git-dir and work-dir should't create .git file in working directory
Personne n'a encore pris cette issue.
- Langage dominant
- C#
- Étoiles
- 3.5k
- Forks
- 925
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
Reproduction steps
Repository.Init("/working/path", "/git/path");
Expected behavior
For most cases the whole point of doing this separation of working directory and git directory is to avoid the existence of .git file/folder in working directory
Actual behavior
The repo_is_worktree in repository.c of libgit2, should not checking for gitdir in working directory.
In config file, in git directory there is a field worktree = /working/path which could be used to find out which is the working directory.
My suggestion would be, in private Repository constructor to get the worktree value from config file in git-directory and pass it to the Proxy.git_repository_set_workdir in Repository class
instead of reading the value from options that were given from caller.
Future improvement would be not event passing the working directory, because it can be extracted from config file.
Hope to hear soon your opinion on this
Max
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par Repository.Init et le constructeur privé de Repository, puis examinez Repository.cs autour de Proxy.git_repository_set_workdir. Comparez ce chemin avec repo_is_worktree et la gestion de gitdir dans src/repository.c, en utilisant la valeur de worktree dans la configuration du répertoire Git comme indiqué. Reproduisez le problème avec des chemins de travail et Git distincts et confirmez que l’initialisation ne crée plus de fichier .git dans le répertoire de travail.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- csharp, git
- Domaine
- tooling
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100