Here's the same patch, but with a commit message that pretends to know
what is going on.

>From 3f848b526f03b52787398842dd861da217ee2fe4 Mon Sep 17 00:00:00 2001
From: David Bremner <[email protected]>
Date: Sat, 17 Mar 2018 15:04:48 -0300
Subject: [PATCH] debcherry: dereference commit object from tags

Apparently git rev-parse changed so that it returns the tag object (in
the case where it exists) rather than the underlying commit
object. This messes up debcherry's attempt to create a detached HEAD.
This patch, originally by James McCoy

     https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=887963#10

works around this using the $tag^{} syntax.
---
 git-debcherry | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/git-debcherry b/git-debcherry
index 1ec1207..342a5f8 100755
--- a/git-debcherry
+++ b/git-debcherry
@@ -149,13 +149,13 @@ fi
 _time $LINENO
 
 upstream=$1
-if ! upstream_sha1=$(git rev-parse "$upstream" 2>$log); then
+if ! upstream_sha1=$(git rev-parse "$upstream"^{} 2>$log); then
     _die "bad or missing ref: $upstream"
 fi
 
 head=${2-$(git symbolic-ref HEAD)}
 head=${head##refs/heads/}
-if ! head_sha1=$(git rev-parse "$head" 2>$log); then
+if ! head_sha1=$(git rev-parse "$head"^{} 2>$log); then
     _die "bad or missing ref: $head"
 fi
 
-- 
2.16.2

Reply via email to