mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-06 11:19:47 +00:00
Merge pull request #2977 from pks-t/submodule-sync-url-fix
Fix git_submodule_sync writing URL to wrong key.
This commit is contained in:
commit
c07d02064d
@ -1091,10 +1091,10 @@ int git_submodule_sync(git_submodule *sm)
|
|||||||
/* return error from reading submodule config */;
|
/* return error from reading submodule config */;
|
||||||
else if ((error = lookup_head_remote_key(&remote_name, smrepo)) < 0) {
|
else if ((error = lookup_head_remote_key(&remote_name, smrepo)) < 0) {
|
||||||
giterr_clear();
|
giterr_clear();
|
||||||
error = git_buf_sets(&key, "branch.origin.remote");
|
error = git_buf_sets(&key, "remote.origin.url");
|
||||||
} else {
|
} else {
|
||||||
error = git_buf_join3(
|
error = git_buf_join3(
|
||||||
&key, '.', "branch", remote_name.ptr, "remote");
|
&key, '.', "remote", remote_name.ptr, "url");
|
||||||
git_buf_free(&remote_name);
|
git_buf_free(&remote_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,11 +118,11 @@ void test_submodule_modify__sync(void)
|
|||||||
|
|
||||||
/* check that submodule config is updated */
|
/* check that submodule config is updated */
|
||||||
assert_submodule_url_is_synced(
|
assert_submodule_url_is_synced(
|
||||||
sm1, "submodule."SM1".url", "branch.origin.remote");
|
sm1, "submodule."SM1".url", "remote.origin.url");
|
||||||
assert_submodule_url_is_synced(
|
assert_submodule_url_is_synced(
|
||||||
sm2, "submodule."SM2".url", "branch.origin.remote");
|
sm2, "submodule."SM2".url", "remote.origin.url");
|
||||||
assert_submodule_url_is_synced(
|
assert_submodule_url_is_synced(
|
||||||
sm3, "submodule."SM3".url", "branch.origin.remote");
|
sm3, "submodule."SM3".url", "remote.origin.url");
|
||||||
|
|
||||||
git_submodule_free(sm1);
|
git_submodule_free(sm1);
|
||||||
git_submodule_free(sm2);
|
git_submodule_free(sm2);
|
||||||
|
Loading…
Reference in New Issue
Block a user