Re: Bug report: checkout-index --temp path is not always relative to the current directory
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Dec 30, 2014, 22:25 UTC
- Message-ID
- <CAPig+cRSfb=tQ4zUnzutZsj_R590juPU-jFCdJ6+E=x51tguRQ@mail.gmail.com>
- In-Reply-To
- <CAFAcib9tz+EDqWx=nohxEbH3FRbwUweabKHTyBF-dioh6G-KKg@mail.gmail.com>
On Tue, Dec 30, 2014 at 5:21 PM, Josh Bleecher Snyder <josharian@gmail.com> wrote:
Show 6 quoted lines
> In the section on using --temp, 'git help checkout-index' says: > > "The path field is always relative to the current directory and the > temporary file names are always relative to the top level directory." > > However, this can be false when an absolute path to the file is provided.
See [1] for a fix.
[1]: http://thread.gmane.org/gmane.comp.version-control.git/261796
Show 33 quoted lines
> Reproduction: > > ~$ git version > git version 2.2.1 > ~$ mkdir demo > ~$ cd demo > ~/demo$ mkdir a > ~/demo$ echo "a" > a/f > ~/demo$ mkdir b > ~/demo$ echo "b" > b/f > ~/demo$ git init . > Initialized empty Git repository in ~/demo/.git/ > ~/demo$ git add . > ~/demo$ git commit -m "init" > [master (root-commit) 2afa910] init > 2 files changed, 2 insertions(+) > create mode 100644 a/f > create mode 100644 b/f > ~/demo$ echo "b2" > b/f > ~/demo$ cd a > ~/demo/a$ git checkout-index --temp -- `git rev-parse --show-toplevel`/b/f > .merge_file_xm8RTd f > ~/demo/a$ cat ../.merge_file_xm8RTd > b > > Note that if f in the checkout-index output is interpreted as relative > to the current directory, it would refer to a/f, whereas in fact is it > b/f. > > This led to https://github.com/golang/go/issues/9476. > > Thanks, > Josh