summaryrefslogtreecommitdiff
path: root/scripts/objdiff
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/objdiff')
-rwxr-xr-xscripts/objdiff12
1 files changed, 5 insertions, 7 deletions
diff --git a/scripts/objdiff b/scripts/objdiff
index b3e4f10bfc3e..b8f7fc60563e 100755
--- a/scripts/objdiff
+++ b/scripts/objdiff
@@ -25,17 +25,15 @@
#
# Note: 'make mrproper' will also remove .tmp_objdiff
-GIT_DIR="`git rev-parse --git-dir`"
+SRCTREE=$(git rev-parse --show-toplevel 2>/dev/null)
-if [ -d "$GIT_DIR" ]; then
- TMPD="${GIT_DIR%git}tmp_objdiff"
-
- [ -d "$TMPD" ] || mkdir "$TMPD"
-else
- echo "ERROR: git directory not found."
+if [ -z "$SRCTREE" ]; then
+ echo "ERROR: Not a git repository."
exit 1
fi
+TMPD=$SRCTREE/.tmp_objdiff
+
usage() {
echo "Usage: $0 <command> <args>"
echo " record <list of object files>"