Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--remote.c4
-rwxr-xr-xt/t5707-clone-detached.sh2
2 files changed, 4 insertions, 2 deletions
diff --git a/remote.c b/remote.c
index ca42a126ad..f073b1ecf5 100644
--- a/remote.c
+++ b/remote.c
@@ -1667,7 +1667,9 @@ struct ref *guess_remote_head(const struct ref *head,
/* Look for another ref that points there */
for (r = refs; r; r = r->next) {
- if (r != head && !hashcmp(r->old_sha1, head->old_sha1)) {
+ if (r != head &&
+ !prefixcmp(r->name, "refs/heads/") &&
+ !hashcmp(r->old_sha1, head->old_sha1)) {
*tail = copy_ref(r);
tail = &((*tail)->next);
if (!all)
diff --git a/t/t5707-clone-detached.sh b/t/t5707-clone-detached.sh
index 6cecd4cd3c..d63b1e390e 100755
--- a/t/t5707-clone-detached.sh
+++ b/t/t5707-clone-detached.sh
@@ -41,7 +41,7 @@ test_expect_success 'cloned HEAD matches' '
git --git-dir=detached-tag/.git log -1 --format=%s >actual &&
test_cmp expect actual
'
-test_expect_failure 'cloned HEAD is detached' '
+test_expect_success 'cloned HEAD is detached' '
head_is_detached detached-tag
'