builder: Properly check for gitlink trees

Instead of expecting the second word to be "commit", we should do like
git does and check for the file mode, which is 160000 for gitlink trees.

https://github.com/git/git/blob/cda1bbd474805e653dda8a71d4ea3790e2a66cbb/cache.h#L96
This commit is contained in:
Mathieu Bridon committed 2016-09-13 00:24:42 +02:00
1 parent 95891501a0
commit 5430d4d40e
1 file changed
+2 -2
+2 -2
View File
@@ -327,7 +327,7 @@ git_mirror_submodules (const char *repo_location,
words = g_strsplit_set (lines[0], " \t", 4);
if (g_strcmp0 (words[1], "commit") != 0)
if (g_strcmp0 (words[0], "160000") != 0)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Not a gitlink tree: %s", path);
return FALSE;
@@ -482,7 +482,7 @@ git_extract_submodule (const char *repo_location,
words = g_strsplit_set (lines[0], " \t", 4);
if (g_strcmp0 (words[1], "commit") != 0)
if (g_strcmp0 (words[0], "160000") != 0)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Not a gitlink tree: %s", path);
return FALSE;