From 5430d4d40ec71bbb81bba36ed34e4fc6f92ecf3c Mon Sep 17 00:00:00 2001 From: Mathieu Bridon Date: Mon, 12 Sep 2016 23:07:07 +0200 Subject: [PATCH] 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 --- builder/builder-source-git.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/builder-source-git.c b/builder/builder-source-git.c index e0111005..164a42cc 100644 --- a/builder/builder-source-git.c +++ b/builder/builder-source-git.c @@ -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;