Skip to content

POSIX-to-Windows path conversion discards trailing backslash? #1695

Closed
@MarcelNehring

Description

@MarcelNehring
  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.17.1.windows.2
cpu: x86_64
built from commit: a60968cf435951d9411fc0f980a2e362d5cccea2
sizeof-long: 4
  • 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.17134.48]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
$ cat /etc/install-options.txt

Editor Option: VIM
Path Option: Cmd
SSH Option: OpenSSH
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Disabled

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Bash

$ MY_TMP="$(mktemp -d)"
$ echo $MY_TMP
/tmp/tmp.GVpowzwlaC
$ git checkout-index --prefix="$MY_TMP/" -f -- "test.cpp"
  • What did you expect to occur after running these commands?

The file test.cpp being checked out into /tmp/tmp.GVpowzwlaC/test.cpp

  • What actually happened instead?

The file test.cpp being checked out into /tmp/tmp.GVpowzwlaCtest.cpp

Not sure if I do something wrong or if maybe POSIX-to-Windows path conversion discards a trailing backslash? The issue appeared after I upgraded from v2.16.0(2). Note that printing the variable seems to work as expected.

$ echo $MY_TMP/
/tmp/tmp.GVpowzwlaC/

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions