Skip to contentSkip to conversation

git-reset: print always the status when HEAD changes

PATCH New Santi Béjar 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 git-reset: print always the status when HEAD changes

---
 git-reset.sh |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
git-reset.sh +8 -6
index fee6d98..a2405c6 100755
@@ -84,14 +84,16 @@ fi
 git-update-ref -m "$GIT_REFLOG_ACTION" HEAD "$rev"
 update_ref_status=$?
 
+if test $update_ref_status = 0 && test "$orig" != "$rev"
+then
+	printf "HEAD is now at "
+	GIT_PAGER= git log --max-count=1 --pretty=oneline \
+		--abbrev-commit HEAD
+fi
+
 case "$reset_type" in
 --hard )
-	test $update_ref_status = 0 && {
-		printf "HEAD is now at "
-		GIT_PAGER= git log --max-count=1 --pretty=oneline \
-			--abbrev-commit HEAD
-	}
-	;;
+	;; # Nothing else to do
 --soft )
 	;; # Nothing else to do
 --mixed )
Signature · 1 line
1.5.0.rc1.ga98e3