Skip to contentSkip to conversation

cg-object-id: accept $id when .git/refs/$id exists

PATCH New Jonas Fonseca 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cg-object-id: accept $id when .git/refs/$id exists

Makes the (universal) -r argument work better with tools like bisect.

---

... until cg-object-id will use git-rev-parse.

commit c0a9b8feb79d72f7c02f37392da840dbad446dbd
tree 8a44e96d29c2171ce1915165ce84d1b1f3e27807
parent f3576824058588cf3fdeca0a8b5ae46b9d37a812
author Jonas Fonseca <[email protected]> Mon, 28 Nov 2005 03:49:11 +0100 committer Jonas Fonseca <[email protected]> Mon, 28 Nov 2005 03:49:11 +0100

 cg-object-id |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
cg-object-id +3 -0
index f2cb54e..ec0362a 100755
@@ -59,6 +59,9 @@ normalize_id()
 	elif [ -r "$_git/refs/heads/$id" ]; then
 		read id < "$_git/refs/heads/$id"
 
+	elif [ -r "$_git/refs/$id" ]; then
+		read id < "$_git/refs/$id"
+
 	# Short id's must be lower case and at least 4 digits.
 	elif [[ "$id" == [0-9a-f][0-9a-f][0-9a-f][0-9a-f]* ]]; then
 		idpref=${id:0:2}
Signature · 1 line
Jonas Fonseca