Skip to content

pack-refs --all fails when temporary .lock file is longer than MAX_PATH but ref name is shorter than MAX_PATH (core.longPaths enabled) #1218

Closed
@kevin-david

Description

@kevin-david

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
> git --version --build-options
git version 2.13.2.windows.1
built from commit: 914b84c9d949b14a135ab50c8b881cdee9be116c
sizeof-long: 4
machine: x86_64
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
> cmd.exe /c ver
Microsoft Windows [Version 10.0.16193.1001]
  • What options did you set as part of the installation? Or did you choose the
    defaults? Defaults, I think:
Path Option: Cmd
SSH Option: OpenSSH
CURL Option: WinSSL
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Enabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?
> git config core.longPaths
true

If the full ref path is longer than 260 characters, everything works as intended. This only seems to repro when the full ref path is under 260 without .lock but over 260 with .lock

Details

  • What commands did you run to trigger this issue?

From a git bash prompt, assuming you can use /d/ as a temporary drive path for testing...

cd /
mkdir -p /d/FileCache/Proxy/file/
cd /d/FileCache/Proxy/file/
git clone https://github.com/kevin-david/test-shallow.git 449f5d8c23864896ba60549eaf335291
cd 449f5d8c23864896ba60549eaf335291/.git/
mv * .. 
git config core.bare true
cd .. 
echo "# pack-refs with: peeled fully-peeled" > packed-refs
git fetch
git pack-refs --all
  • What did you expect to occur after running these commands?

pack-refs --all succeeds

  • What actually happened instead?
$ git pack-refs --all
error: cannot lock ref 'refs/remotes/origin/user/aschoorl/cherrypick-change-play-event-to-take-audioplaybackevents-as-parameter-on-official-rs_apps_comms-on-user-stevek/audioplayer_new-revert-from-user-stevek/audioplayer_new': Unable to create 'D:/FileCache/Proxy/file/449f5d8c23864896ba60549eaf335291/./refs/remotes/origin/user/aschoorl/cherrypick-change-play-event-to-take-audioplaybackevents-as-parameter-on-official-rs_apps_comms-on-user-stevek/audioplayer_new-revert-from-user-stevek/audioplayer_new.lock': Filename too long

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions