Skip to content

Diff::a_path is wrong for unicode characters #1099

@marxin

Description

@marxin

The problem is slightly mentioned in #865.

Let's consider the following example:

git init foo
cd ./foo
echo a > a
git add a
git commit -a -m 'Add a'
echo "foo" > špatně.txt
git add špatně.txt
git commit -a -m Add
In [4]: Repo('.').commit().diff('HEAD~')[0].a_path
Out[4]: '"\\305\\241patn\\304\\233.txt"'

Unless one uses git config --global core.quotepath false, the file name is quoted and I don't see a simple solution how to decode it to unicode? One can use -z option that can resolve the problem:

git diff HEAD~ --raw -z | cat
:000000 100644 0000000 257cc56 Ašpatně.txt

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy