Directory in repo gets first letter of name duplicated in index but not filesystem, can't commit anymore
See original GitHub issueDescription
Using GitHub Desktop to access an internal repo, after checking out code and moving folders around, a commit and push worked fine. but a later fetch created a bizarre issue where the filename of one of the folders has the first letter of the name duplicated. This applies only to the index of the files in GitHub Desktop, not the actual filesystem folders.
Because of this, further commits, pushes or fetches always generate an error, usually about invalid paths.
Version
GitHub Desktop version: 1.0.10
OS version: Windows 7 Enterprise
Steps to Reproduce
- Clone a repo using the URL option
- Fetch files
- In the local filesystem, add a new folder such as “foo bar” and move files into it
- Commit the changes
- Push the repo.
- Do a fetch to synch any changes
- Observe if recently created folder is now listed with an extra letter, i.e. “ffoo bar” in index.
- Make a few changes
- Attempt to commit changes, observe error message.
Expected behavior: Foldernames not to change, commits to work
Actual behavior: Index munges folder name, loses its mind, Github becomes useless, children cry
Reproduces how often: 100% with the specific internal repo, do not know if it happens elsewhere.
Logs
2017-12-11T15:36:31.381Z - info: [ui] [AppStore] loading 1 repositories from store
2017-12-11T15:36:33.197Z - info: [ui] Executing getBranches: git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%1F refs/heads refs/remotes (took 1.640s)
2017-12-11T15:36:33.525Z - info: [ui] Executing getRecentBranches: git log -g --no-abbrev-commit --pretty=oneline HEAD -n 2500 – (took 1.951s)
2017-12-11T15:36:33.852Z - info: [ui] Executing getStatus: git status --untracked-files=all --branch --porcelain=2 -z (took 2.478s)
2017-12-11T15:36:34.929Z - info: [ui] Executing getWorkingDirectoryDiff: git diff HEAD --no-ext-diff --patch-with-raw -z --no-color – 000 README.txt (took 1.059s)
2017-12-11T15:36:36.334Z - info: [ui] launching: 1.0.10 (Windows 6.1.7601)
2017-12-11T15:36:36.854Z - info: [ui] Executing getStatus: git status --untracked-files=all --branch --porcelain=2 -z (took 1.088s)
2017-12-11T15:36:37.915Z - info: [ui] Executing getAuthorIdentity: git var GIT_AUTHOR_IDENT (took 1.022s)
2017-12-11T15:36:40.846Z - info: [ui] Executing installGlobalLFSFilter: git lfs install --skip-repo (took 4.876s)
2017-12-11T15:38:00.071Z - error: [ui] git reset -- .
exited with an unexpected code: 128.
error: Invalid path 'prod/'
fatal: make_cache_entry failed for path 'prod/'
2017-12-11T15:40:00.743Z - info: [ui] Executing getStatus: git status --untracked-files=all --branch --porcelain=2 -z (took 1.169s)
2017-12-11T15:41:16.253Z - info: [ui] Executing getStatus: git status --untracked-files=all --branch --porcelain=2 -z (took 1.156s)
2017-12-11T15:42:52.246Z - info: [ui] Executing getStatus: git status --untracked-files=all --branch --porcelain=2 -z (took 1.126s)
2017-12-11T15:43:52.905Z - error: [ui] git reset -- .
exited with an unexpected code: 128.
error: Invalid path 'prod/'
fatal: make_cache_entry failed for path 'prod/'
2017-12-11T15:48:15.034Z - info: [ui] Executing getStatus: git status --untracked-files=all --branch --porcelain=2 -z (took 1.138s) 2017-12-11T15:48:16.176Z - info: [ui] Executing getWorkingDirectoryDiff: git diff HEAD --no-ext-diff --patch-with-raw -z --no-color – prod/\ (took 1.131s) 2017-12-11T15:50:55.919Z - info: [ui] Executing getStatus: git status --untracked-files=all --branch --porcelain=2 -z (took 1.207s) 2017-12-11T15:51:55.592Z - info: [ui] Executing getStatus: git status --untracked-files=all --branch --porcelain=2 -z (took 1.118s) 2017-12-11T15:52:49.754Z - info: [ui] Executing getStatus: git status --untracked-files=all --branch --porcelain=2 -z (took 1.013s)
Additional Information
Important note: While the log says the folder name is "prof/" there are no special characters in the folder name. I have also verified that I can clone this repo on a RHEL box using git with no errors, and commit changes as well.
I have tried wiping the local repo and re-cloning. Oddly, it will download everything just fine. Only afterwards does it munge the index and refuse future commits. This has eliminated any usefulness in using Github desktop as now I need to copy the files off the local PC to a Linux box, commit them there, and push… Then delete the repo on my Windows system and re-clone.
😕
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (2 by maintainers)
Top GitHub Comments
I had the same issue and I found that the directories getting an extra letter had a .git from an old clone from another repository. Fixed it by simply removing the .git folders from the directories that had the issue.
@nojdh Was the old .git folder on the Windows filesystem prior to the issue? Or in the repo you cloned?
That may be what happened to me, I’ll need to check it in the office today.