summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f8948e2)
raw | patch | inline | side by side (parent: f8948e2)
author | Junio C Hamano <gitster@pobox.com> | |
Mon, 9 Feb 2009 07:52:01 +0000 (23:52 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 11 Feb 2009 06:26:32 +0000 (22:26 -0800) |
The previous one squelched the diagnositic message we used to issue every
time we enumerated the refs and noticed a dangling ref. This adds the
warning back to the place where the user actually attempts to use it.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
time we enumerated the refs and noticed a dangling ref. This adds the
warning back to the place where the user actually attempts to use it.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_name.c | patch | blob | history | |
t/t5505-remote.sh | patch | blob | history |
diff --git a/sha1_name.c b/sha1_name.c
index 5d0ac0263d04d7ec72a3b7dec4aaf47aec80da5e..3bd2ef0e7cde84d9d425f510bb2c2d52e8b19e16 100644 (file)
--- a/sha1_name.c
+++ b/sha1_name.c
char fullref[PATH_MAX];
unsigned char sha1_from_ref[20];
unsigned char *this_result;
+ int flag;
this_result = refs_found ? sha1_from_ref : sha1;
mksnpath(fullref, sizeof(fullref), *p, len, str);
- r = resolve_ref(fullref, this_result, 1, NULL);
+ r = resolve_ref(fullref, this_result, 1, &flag);
if (r) {
if (!refs_found++)
*ref = xstrdup(r);
if (!warn_ambiguous_refs)
break;
- }
+ } else if (flag & REF_ISSYMREF)
+ warning("ignoring dangling symref %s.", fullref);
}
free(last_branch);
return refs_found;
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index 2067dc558ff3dc4dcbe1703e5ba5b7511e85d661..eb637184a00007c61e6d92f7b5546eed6ec5a0ae 100755 (executable)
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
git branch -a
) 2>err &&
! grep "points nowhere" err
+ (
+ cd seven &&
+ test_must_fail git branch nomore origin
+ ) 2>err &&
+ grep "dangling symref" err
'
test_done
+