Skip to content

Commit

Permalink
Codechange: Prioritise .ottdrev file over git checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
LordAro committed Apr 1, 2021
1 parent 27906b1 commit 9673f6a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions findversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ ROOT_DIR=`pwd`
# Determine if we are using a modified version
# Assume the dir is not modified
MODIFIED="0"
if [ -d "$ROOT_DIR/.git" ] || [ -f "$ROOT_DIR/.git" ]; then
if [ -f "$ROOT_DIR/.ottdrev" ]; then
# We are an exported source bundle
cat $ROOT_DIR/.ottdrev
exit

elif [ -d "$ROOT_DIR/.git" ] || [ -f "$ROOT_DIR/.git" ]; then
# We are a git checkout
# Refresh the index to make sure file stat info is in sync, then look for modifications
git update-index --refresh >/dev/null
Expand Down Expand Up @@ -92,10 +97,6 @@ if [ -d "$ROOT_DIR/.git" ] || [ -f "$ROOT_DIR/.git" ]; then
ISSTABLETAG="0"
fi

elif [ -f "$ROOT_DIR/.ottdrev" ]; then
# We are an exported source bundle
cat $ROOT_DIR/.ottdrev
exit
else
# We don't know
MODIFIED="1"
Expand Down

0 comments on commit 9673f6a

Please sign in to comment.