Re: Dokumenting api-paths.txt
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Aug 20, 2013, 21:59 UTC
- Message-ID
- <20130820215911.GJ4110@google.com>
- In-Reply-To
- <5213E240.9080106@googlemail.com>
Stefan Beller wrote:
>>> On 08/20/2013 03:31 PM, Johannes Sixt wrote: >>>> Stefan Beller wrote:
Show 7 quoted lines
>>>>> + packdir = mkpathdup("%s/pack", get_object_directory());
>>>>> + packtmp = mkpathdup("%s/.tmp-%d-pack", packdir, getpid());
>>>>
>>>> Should this not be
>>>>
>>>> packdir = xstrdup(git_path("pack"));
>>>> packtmp = xstrdup(git_path("pack/.tmp-%d-pack", getpid()));[...]
Show 8 quoted lines
> So if I have
> packdir = xstrdup(git_path("pack"));
> ...
> path = git_path("%s/%s", packdir, filename)
>
> This produces something as:
> .git/.git/objects/pack/.tmp-13199-pack-c59c5758ef159b272f6ab10cb9fadee443966e71.idx
> definitely having one .git too much.The version with get_object_directory() was right. The object directory is not even necessarily under .git/, since it can be overridden using the GIT_OBJECT_DIRECTORY envvar.
> Also interesting to add would be that git_path operates in the > .git/objects directory?
git_path is for resolving paths within GIT_DIR, such as git_path("config") and git_path("COMMIT_EDITMSG").
Jonathan