Re: [PATCH 7/7] sha1_file: write ref_name to link object
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- Apr 5, 2013, 07:03 UTC
- Message-ID
- <CALkWK0m5q7gW0LPdJVWbZTkTnHrFBYyfRxFMnRMtyuSePtLL9Q@mail.gmail.com>
- In-Reply-To
- <1365100243-13676-8-git-send-email-artagnon@gmail.com>
Ramkumar Ramachandra wrote:
> Great. Now, we just have to write refs/modules/<branch>/* at > commit-time.
Actually, we have to update things in refs/modules/ everytime we update things in refs/heads/. In the case of a 'git branch -M' for example, refs/heads/<oldname> is rewritten to refs/heads/<newname>: similarly, refs/modules/<oldname>/ needs to be moved to refs/modules/<newname>/.
There is one special case worth mentioning. Let's say I'm committing changes to link objects to a detached HEAD, b8bb3f. Then, I write refs/modules/b8bb3f/ at commit-time. A subsequent 'checkout -b' that updates refs/heads/<newbranch> will just have to move refs/modules/b8bb3f/ to refs/modules/<newbranch>/.
The caveat is that I might commit to the detached HEAD and leave it hanging around until the next gc. So, gc will need to remove refs/modules/b8bb3f/ too, but that's not a pressing issue at the moment.