]> git.proxmox.com Git - libgit2.git/blobdiff - src/submodule.c
Add range checking around cache opts
[libgit2.git] / src / submodule.c
index 957766dfc67ce0d3a6121795c9d6815aa2df06c8..0a22e3b13e55b93ce74c5e51fd0745a985a49f37 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "common.h"
 #include "git2/config.h"
+#include "git2/sys/config.h"
 #include "git2/types.h"
 #include "git2/repository.h"
 #include "git2/index.h"
@@ -694,7 +695,7 @@ int git_submodule_open(
        git_buf_free(&path);
 
        /* if we have opened the submodule successfully, let's grab the HEAD OID */
-       if (!error && !(submodule->flags & GIT_SUBMODULE_STATUS__WD_OID_VALID)) {
+       if (!error) {
                if (!git_reference_name_to_id(
                                &submodule->wd_oid, *subrepo, GIT_HEAD_FILE))
                        submodule->flags |= GIT_SUBMODULE_STATUS__WD_OID_VALID;
@@ -1327,7 +1328,7 @@ static int lookup_head_remote(git_buf *url, git_repository *repo)
                goto cleanup;
        }
 
-       if ((error = git_branch_tracking(&remote, head)) < 0)
+       if ((error = git_branch_upstream(&remote, head)) < 0)
                goto cleanup;
 
        /* remote should refer to something like refs/remotes/ORIGIN/BRANCH */