summaryrefslogtreecommitdiff
path: root/src/submodule.c
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2012-10-08 15:25:44 -0700
committerBen Straub <bs@github.com>2012-10-08 15:25:44 -0700
commit9adfa7d147b319593789cbaeea94a97141b1e4f8 (patch)
treebd9a22164040adc03d389aa101e9d480cb2ce775 /src/submodule.c
parent543864b677704845660085d2b2b2249cabb084a4 (diff)
parentbf0e62a2b8b6116ae61dae37f95a3eb840246ec6 (diff)
downloadlibgit2-9adfa7d147b319593789cbaeea94a97141b1e4f8.tar.gz
Merge pull request #949 from nulltoken/topic/deploy_repository_set_head
Deploy git_repository_set_head()
Diffstat (limited to 'src/submodule.c')
-rw-r--r--src/submodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/submodule.c b/src/submodule.c
index a2162496a..180528641 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -1315,7 +1315,7 @@ static int lookup_head_remote(git_buf *url, git_repository *repo)
/* remote should refer to something like refs/remotes/ORIGIN/BRANCH */
if (git_reference_type(remote) != GIT_REF_SYMBOLIC ||
- git__prefixcmp(git_reference_target(remote), "refs/remotes/") != 0)
+ git__prefixcmp(git_reference_target(remote), GIT_REFS_REMOTES_DIR) != 0)
{
giterr_set(GITERR_SUBMODULE,
"Cannot resolve relative URL when HEAD is not symbolic");
@@ -1323,7 +1323,7 @@ static int lookup_head_remote(git_buf *url, git_repository *repo)
goto cleanup;
}
- scan = tgt = git_reference_target(remote) + strlen("refs/remotes/");
+ scan = tgt = git_reference_target(remote) + strlen(GIT_REFS_REMOTES_DIR);
while (*scan && (*scan != '/' || (scan > tgt && scan[-1] != '\\')))
scan++; /* find non-escaped slash to end ORIGIN name */