chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a4cde71
)
Test suite: Provide t-git-get-ref-exact
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 13 Jun 2015 19:28:31 +0000
(20:28 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 13 Jun 2015 19:28:31 +0000
(20:28 +0100)
No callers right now but I keep reinventing this.
tests/lib
patch
|
blob
|
history
diff --git
a/tests/lib
b/tests/lib
index e1bc6d941e8f66b60f1d4d5d1d089049e6da4bcc..0b0ae47280f0158efd3471ccf869d25afe6c1414 100644
(file)
--- a/
tests/lib
+++ b/
tests/lib
@@
-302,6
+302,16
@@
t-clean-on-branch () {
t-output "## $1" git status -b --porcelain
}
+t-git-get-ref-exact () {
+ local ref=$1
+ # does not dereference, unlike t-git-get-ref
+ case "$ref" in
+ refs/*) ;;
+ *) fail "t-git-get-ref-exact bad $ref" ;;
+ esac
+ git for-each-ref --format='%(objectname)' "[r]efs/${ref#refs/}"
+}
+
t-git-get-ref () {
local ref=$1
case "$ref" in