[dim PATCH v2 6/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 76e129de873d..69c22f6206f0 100755
--- a/dim
+++ b/dim
@@ -1419,6 +1419,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" | \
@@ -1429,9 +1434,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