Re: git-config: replaces ~/.gitconfig symlink with real file
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jul 15, 2007, 23:30 UTC
- Message-ID
- <Pine.LNX.4.64.0707160029120.14781@racer.site>
- In-Reply-To
- <f158199e0707151427h52da3e38rae3be6e44e27e918@mail.gmail.com>
Hi,
On Sun, 15 Jul 2007, Bradford Smith wrote:
> If I were to fix this, I'd be tempted to use realpath(3) to follow the > symlink, but I don't think it's very reliably available cross-platform. > Certainly, it isn't used anywhere in the current git code. Can anyone > suggest a more portable fix?
I'd use readlink(2) and test for EINVAL to fall back to the current behaviour.
Hth, Dscho