Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t1417-reflog-updateref.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t1417-reflog-updateref.sh` 68 lines ยท 2213 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='git reflog --updateref' 4 5 . ./test-lib.sh 6 7 test_expect_success 'setup' ' 8 git init -b main repo && 9 ( 10 cd repo && 11 12 test_commit A && 13 test_commit B && 14 test_commit C && 15 16 git reflog HEAD >expect && 17 git reset --hard HEAD~ && 18 # Make sure that the reflog does not point to the same commit 19 # as HEAD. 20 git reflog delete HEAD@{0} && 21 git reflog HEAD >actual && 22 test_cmp expect actual 23 ) 24 ' 25 26 test_reflog_updateref () { 27 exp=$1 28 shift 29 args="$@" 30 31 test_expect_success "get '$exp' with '$args'" ' 32 test_when_finished "rm -rf copy" && 33 cp -R repo copy && 34 35 ( 36 cd copy && 37 38 $args && 39 git rev-parse $exp >expect && 40 git rev-parse HEAD >actual && 41 42 test_cmp expect actual 43 ) 44 ' 45 } 46 47 test_reflog_updateref B git reflog delete --updateref HEAD@{0} 48 test_reflog_updateref B git reflog delete --updateref HEAD@{1} 49 test_reflog_updateref C git reflog delete --updateref main@{0} 50 test_reflog_updateref B git reflog delete --updateref main@{1} 51 test_reflog_updateref B git reflog delete --updateref --rewrite HEAD@{0} 52 test_reflog_updateref B git reflog delete --updateref --rewrite HEAD@{1} 53 test_reflog_updateref C git reflog delete --updateref --rewrite main@{0} 54 test_reflog_updateref B git reflog delete --updateref --rewrite main@{1} 55 test_reflog_updateref B test_must_fail git reflog expire HEAD@{0} 56 test_reflog_updateref B test_must_fail git reflog expire HEAD@{1} 57 test_reflog_updateref B test_must_fail git reflog expire main@{0} 58 test_reflog_updateref B test_must_fail git reflog expire main@{1} 59 test_reflog_updateref B test_must_fail git reflog expire --updateref HEAD@{0} 60 test_reflog_updateref B test_must_fail git reflog expire --updateref HEAD@{1} 61 test_reflog_updateref B test_must_fail git reflog expire --updateref main@{0} 62 test_reflog_updateref B test_must_fail git reflog expire --updateref main@{1} 63 test_reflog_updateref B test_must_fail git reflog expire --updateref --rewrite HEAD@{0} 64 test_reflog_updateref B test_must_fail git reflog expire --updateref --rewrite HEAD@{1} 65 test_reflog_updateref B test_must_fail git reflog expire --updateref --rewrite main@{0} 66 test_reflog_updateref B test_must_fail git reflog expire --updateref --rewrite main@{1} 67 68 test_done