Commit fbcc8bd106356d615ca06a2d66175cbf544c878f

kdj0c 2019-12-18T13:42:44

submodule sync, fix edge case with submodule sync on empty repo

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/submodule.c b/src/submodule.c
index 78ce7c7..1efc947 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -2170,7 +2170,7 @@ static int lookup_default_remote(git_remote **remote, git_repository *repo)
 	int error = lookup_head_remote(remote, repo);
 
 	/* if that failed, use 'origin' instead */
-	if (error == GIT_ENOTFOUND)
+	if (error == GIT_ENOTFOUND || error == GIT_EUNBORNBRANCH)
 		error = git_remote_lookup(remote, repo, "origin");
 
 	if (error == GIT_ENOTFOUND)