Thread (70 messages) flat view 70 messages, 12 authors, 2016-06-15

Re: [PATCH 3/6] Add 'resolve_gitlink_ref()' helper function

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:43:03


On Tue, 10 Apr 2007, Alex Riesen wrote:
On 4/10/07, Linus Torvalds [off-list ref] wrote:
quoted
+int resolve_gitlink_ref(const char *path, const char *refname, unsigned
char *result)
+{
+       int len = strlen(path), retval;
+       char *gitdir;
+
+       while (len && path[len-1] == '/')
+               len--;
+       if (!len)
+               return -1;
+       gitdir = xmalloc(len + MAXREFLEN + 8);
+       memcpy(gitdir, path, len);
+       memcpy(gitdir + len, "/.git/", 7);
Can't a subproject be bare?
Not when it is checked out, no. That's what "checked out" means ;)

If a subproject is bare, it never gets resolved, because it's never 
checked out in a superproject.

So a subproject *can* be bare, but when it's bare it is just a totally 
regular independent git project, simply by *definition* of not being 
checked out inside a superproject.

But hey, that was just a design decision of mine, and if people can argue 
for it being wrong, I don't think I'm married to it ;)

		Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help