gifn: shellcheck: define and assign separately

Change-Id: I55ceb8ba83c71738573ddb4ee805d3a9b7620eb7
diff --git a/tools/git-if-needed/sh/git-if-needed b/tools/git-if-needed/sh/git-if-needed
index 9d79cf4..82f4331 100755
--- a/tools/git-if-needed/sh/git-if-needed
+++ b/tools/git-if-needed/sh/git-if-needed
@@ -27,7 +27,8 @@
 		exit 1
 	fi
 
-	local chgid="$(grep -Ee '^[[:space:]]*Change-Id:[[:space:]]+I[0-9a-f]+$' -- "$fname" | awk '{ print $2 }')"
+	local chgid=''
+	chgid="$(grep -Ee '^[[:space:]]*Change-Id:[[:space:]]+I[0-9a-f]+$' -- "$fname" | awk '{ print $2 }')"
 	if ! expr "x$chgid" : 'xI[0-9a-f][0-9a-f]*$' > /dev/null; then
 		echo "Expected a single Change-Id line in $fname" 1>&2
 		exit 1