You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When uploading a bare repository that has an empty refs subdirectory you will get the following error from the repo.OpenRepository() API, and passed back to the user interface:
Failed to open repository of uploaded directory: .git not found
This is because uploading a directory to the browser does not create empty subdirectories.
This does not need to be fixed for the proof-of-concept.
Possible Solution (when needed):
In git-bug, change isGitDirFs() to avoid the issue by changing the checks so that it only checks for directories which contain files, and for files we know should exist. This will allow the validity check to pass. For example, use:
markers := []string{"HEAD", "hooks", "info"}
We must also ensure that any missing directories are created so as not to cause problems using the repository. So, after upload and before the call to git portal src/repo/repo_gitbug.go, repo.OpenRepo(), create all of the empty directories which are created by a git init --bare.
Alternatives:
There may be better alternatives to this, such as creating a bare repository on the browser filesystem and then uploading to it.
The text was updated successfully, but these errors were encountered:
happybeing
changed the title
Failed to open repository of uploaded directory: .git not found
Won't-fix: Failed to open repository of uploaded directory: .git not found
Dec 16, 2020
When uploading a bare repository that has an empty
refs
subdirectory you will get the following error from therepo.OpenRepository()
API, and passed back to the user interface:Failed to open repository of uploaded directory: .git not found
This is because uploading a directory to the browser does not create empty subdirectories.
This does not need to be fixed for the proof-of-concept.
Possible Solution (when needed):
isGitDirFs()
to avoid the issue by changing the checks so that it only checks for directories which contain files, and for files we know should exist. This will allow the validity check to pass. For example, use:src/repo/repo_gitbug.go, repo.OpenRepo()
, create all of the empty directories which are created by agit init --bare
.Alternatives:
There may be better alternatives to this, such as creating a bare repository on the browser filesystem and then uploading to it.
The text was updated successfully, but these errors were encountered: