Re: git rev-parse --show-toplevel doesn't work inside git-dir

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

 



On Wed, Jun 05, 2013 at 10:34:11AM +0300, Orgad Shaneh wrote:

> Running "git rev-parse --show-toplevel" doesn't print anything when it
> is run inside .git dir (on all levels)

This is by design. "--show-toplevel" does not print anything when you
do not have a working tree, and you do not have one if you are inside
the .git directory. If you were to do:

  cd .git
  git --work-tree=.. rev-parse --show-toplevel

(or use GIT_WORK_TREE, or set core.worktree, etc), you would get back
the toplevel of the working tree.

-Peff
--
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]