"git rev-parse --git-dir" fails from inside .git/<any-subdir>

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

 



Hello list!

I noticed that "git rev-parse --git-dir" doesn't work properly
when called from inside a sub-directory of .git.  It seems
setup_git_directory_gently() is the problem, because it simply
calls chdir("..") until "." is a valid git directory and it then
sets GIT_DIR = ".".  But this relative path only works as long as
you stay in the directory that setup_git_directory_gently() has
put you in.  It won't work when git-sh-setup uses GIT_DIR=$(git
rev-parse --git-dir).

This causes "git repack -a -f" to fail with "Nothing new to pack."
from inside .git/objects/pack, which would be handy to test
different parameters and compare the resulting pack files.

I don't know whether setup_git_directory_gently() or rather
builtin-rev-parse.c needs to be changed, I'll let someone else do
this as I don't know the code base well enough.

jlh
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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