summaryrefslogtreecommitdiff
path: root/t/t7600-merge.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-06-13 20:19:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-06-13 20:19:42 (GMT)
commit8d32d2552ee476917d216ae584d3d9b9002844d3 (patch)
tree69f724aff5540a3f604364da1dc32a67c7b02a04 /t/t7600-merge.sh
parente91f65d0e28b9f4dce85f82c5e3e208a54171a14 (diff)
parent2ed2e19958f2bcf59cac18a69b27f74ba7079a2f (diff)
downloadgit-8d32d2552ee476917d216ae584d3d9b9002844d3.zip
git-8d32d2552ee476917d216ae584d3d9b9002844d3.tar.gz
git-8d32d2552ee476917d216ae584d3d9b9002844d3.tar.bz2
Merge branch 'jk/help-unknown-ref-fix'
Improve the code to show args with potential typo that cannot be interpreted as a commit-ish. * jk/help-unknown-ref-fix: help_unknown_ref(): check for refname ambiguity help_unknown_ref(): duplicate collected refnames
Diffstat (limited to 't/t7600-merge.sh')
-rwxr-xr-xt/t7600-merge.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 3e16aae..612ebe7 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -893,4 +893,24 @@ test_expect_success 'merge --quit' '
)
'
+test_expect_success 'merge suggests matching remote refname' '
+ git commit --allow-empty -m not-local &&
+ git update-ref refs/remotes/origin/not-local HEAD &&
+ git reset --hard HEAD^ &&
+
+ # This is white-box testing hackery; we happen to know
+ # that reading packed refs is more picky about the memory
+ # ownership of strings we pass to for_each_ref() callbacks.
+ git pack-refs --all --prune &&
+
+ test_must_fail git merge not-local 2>stderr &&
+ grep origin/not-local stderr
+'
+
+test_expect_success 'suggested names are not ambiguous' '
+ git update-ref refs/heads/origin/not-local HEAD &&
+ test_must_fail git merge not-local 2>stderr &&
+ grep remotes/origin/not-local stderr
+'
+
test_done