[dim PATCH 7/7] dim: check positional parameter on dim fixes and cite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
---
 dim | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/dim b/dim
index fc0bc8e68d2b..8388a57a2ff3 100755
--- a/dim
+++ b/dim
@@ -1413,6 +1413,11 @@ function dim_cite
 	local sha1
 
 	sha1=$1
+	if [[ -z "$sha1" ]]; then
+		echoerr "usage: $dim $subcommand <commit-ish>"
+		return 1
+	fi
+
 	cd $DIM_PREFIX/$DIM_DRM_INTEL
 
 	git log -1 $sha1 "--pretty=format:%H (\"%s\")%n" | \
@@ -1423,9 +1428,13 @@ function dim_fixes
 {
 	local sha1 tag
 
-	cd $DIM_PREFIX/$DIM_DRM_INTEL
 	sha1=$1
+	if [[ -z "$sha1" ]]; then
+		echoerr "usage: $dim $subcommand <commit-ish>"
+		return 1
+	fi
 
+	cd $DIM_PREFIX/$DIM_DRM_INTEL
 	echo "Fixes: $(dim_cite $sha1)"
 
 	(
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux