git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* GIT_INDEX_FILE relative path breaks in subdir
@ 2016-05-17 17:18 Joey Hess
  2016-05-17 17:34 ` Junio C Hamano
  0 siblings, 1 reply; 9+ messages in thread
From: Joey Hess @ 2016-05-17 17:18 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 771 bytes --]

joey@darkstar:/tmp>git init test
Initialized empty Git repository in /tmp/test/.git/
joey@darkstar:/tmp>cd test
joey@darkstar:/tmp/test>mkdir sub
joey@darkstar:/tmp/test>cd sub
joey@darkstar:/tmp/test/sub>GIT_INDEX_FILE=../.git/otherindex git write-tree
fatal: Unable to create '/tmp/test/../.git/otherindex.lock': No such file or directory

Appears to be a bug in git. Seems that it's assuming GIT_INDEX_FILE is
relative to the top of the worktree and not to the CWD.

Workaround: Use absolute path to the index file.

joey@darkstar:/tmp/test/sub>GIT_INDEX_FILE=`pwd`/../.git/otherindex git write-tree
4b825dc642cb6eb9a060e54bf8d69288fbee4904
joey@darkstar:/tmp/test/sub>ls ../.git/otherindex 
../.git/otherindex

git version 2.8.1

-- 
see shy jo

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-05-23 19:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-17 17:18 GIT_INDEX_FILE relative path breaks in subdir Joey Hess
2016-05-17 17:34 ` Junio C Hamano
2016-05-17 18:26   ` Joey Hess
2016-05-22 19:04     ` Joey Hess
2016-05-23 16:44       ` Junio C Hamano
2016-05-23 17:29         ` Joey Hess
2016-05-23 18:30           ` Junio C Hamano
2016-05-23 18:52             ` Joey Hess
2016-05-23 19:44               ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).