summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2017-03-26 02:42:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-04-14 10:53:25 (GMT)
commitadac8115a6e7f9841c48e4fe48b74e0ce652ef58 (patch)
treeb180cc987fbda8dc0ab705d6a7510e4179a483bc /t
parent2269e2a8781ecba066e3d8f262a314b6cfb715dd (diff)
downloadgit-adac8115a6e7f9841c48e4fe48b74e0ce652ef58.zip
git-adac8115a6e7f9841c48e4fe48b74e0ce652ef58.tar.gz
git-adac8115a6e7f9841c48e4fe48b74e0ce652ef58.tar.bz2
refs.h: add a note about sorting order of for_each_ref_*
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t1405-main-ref-store.sh6
-rwxr-xr-xt/t1406-submodule-ref-store.sh6
2 files changed, 12 insertions, 0 deletions
diff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh
index 77e1c13..490521f 100755
--- a/t/t1405-main-ref-store.sh
+++ b/t/t1405-main-ref-store.sh
@@ -53,6 +53,12 @@ test_expect_success 'for_each_ref(refs/heads/)' '
test_cmp expected actual
'
+test_expect_success 'for_each_ref() is sorted' '
+ $RUN for-each-ref refs/heads/ | cut -c 42- >actual &&
+ sort actual > expected &&
+ test_cmp expected actual
+'
+
test_expect_success 'resolve_ref(new-master)' '
SHA1=`git rev-parse new-master` &&
echo "$SHA1 refs/heads/new-master 0x0" >expected &&
diff --git a/t/t1406-submodule-ref-store.sh b/t/t1406-submodule-ref-store.sh
index 22214eb..13b5454 100755
--- a/t/t1406-submodule-ref-store.sh
+++ b/t/t1406-submodule-ref-store.sh
@@ -47,6 +47,12 @@ test_expect_success 'for_each_ref(refs/heads/)' '
test_cmp expected actual
'
+test_expect_success 'for_each_ref() is sorted' '
+ $RUN for-each-ref refs/heads/ | cut -c 42- >actual &&
+ sort actual > expected &&
+ test_cmp expected actual
+'
+
test_expect_success 'resolve_ref(master)' '
SHA1=`git -C sub rev-parse master` &&
echo "$SHA1 refs/heads/master 0x0" >expected &&