Re: Possible bug with git restore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here is a script to reproduce the issue that works for me in Git Bash:

=============================================
#!/bin/bash

#create repo with corresponding structure
mkdir restore_bug_test
cd restore_bug_test
mkdir incl
mkdir src
touch incl/test_file.hpp
touch src/test_file.cpp
git init
git add .
git commit -m"initial"

#add a couple of commits
echo "1" >> incl/test_file.hpp
echo "1" >> src/test_file.cpp
git commit -am"1"
echo "2" >> incl/test_file.hpp
echo "2" >> src/test_file.cpp
git commit -am"2"

#reproduce bug
git restore -s HEAD~ -- *test_file.*
git status
===============================================

Haven't checked filenames explicitly, but they haven't been changed manually.
And there are no explicit case changes in the attached script.

On Sat, Aug 15, 2020 at 1:42 AM Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote:
>
> On Wed, Aug 12, 2020 at 2:51 PM Sergii Shkarnikov
> <sergii.shkarnikov@xxxxxxxxxxxxxxx> wrote:
> >     I tried to restore a couple of files from an earlier commit
> > running the restore command with a wildcard:
> >
> >     git restore -s HEAD~ -- */filename.*
> >
> >     In my work tree those are .cpp and .hpp files stored in different folders.
> >     Both files were deleted (and got (delete) status).
> >     Running this command without wildcards for each file separately
> > works as expected.
>
> Thanks for the report. Can you provide a complete recipe in the form
> of shell command to make this happen so others can reproduce the
> behavior? Doing so will help track down the issue. Also, since this is
> Windows, do the cases of the filenames in the referenced commit match
> the cases actually on the filesystem (and have the cases changed
> between commits)?



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux