Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorm0viefreak <m0viefreak.cm@googlemail.com>2013-01-09 01:18:16 +0400
committerXhmikosR <xhmikosr@users.sourceforge.net>2013-01-09 02:39:34 +0400
commit32f70823833e87a1e82767b1e65680a9b3990bea (patch)
tree8b81022755a885b50d3da0829a736475d5947b9d /contrib
parentb202cbb7d1e28d274780a60534e8117672e7caf5 (diff)
version scripts: make scripts work from every working directory inside the repo
Diffstat (limited to 'contrib')
-rw-r--r--contrib/hash2rev.sh6
-rw-r--r--contrib/rev2hash.sh6
2 files changed, 4 insertions, 8 deletions
diff --git a/contrib/hash2rev.sh b/contrib/hash2rev.sh
index e1c22a6e3..62ec30f0d 100644
--- a/contrib/hash2rev.sh
+++ b/contrib/hash2rev.sh
@@ -22,10 +22,8 @@
svnrev=5597
svnhash="f669833b77e6515dc5f0a682c5bf665f9a81b2ec"
-if [[ ! -d "../.git" ]] || ! command -v git >/dev/null 2>&1 ; then
- # If the folder ".git" doesn't exist or git isn't available exit the script
- exit 1
-fi
+#If the git command isn't available or we are not inside a git repo exit the script
+git rev-parse --git-dir > /dev/null 2>&1 || exit 1
# If the input hash is after the switch to git
if [[ $(git merge-base $svnhash "$1") == $(git rev-parse --verify "$svnhash") ]] ; then
diff --git a/contrib/rev2hash.sh b/contrib/rev2hash.sh
index 1ef6ca6f8..6826cee9b 100644
--- a/contrib/rev2hash.sh
+++ b/contrib/rev2hash.sh
@@ -22,10 +22,8 @@
svnrev=5597
svnhash="f669833b77e6515dc5f0a682c5bf665f9a81b2ec"
-if [[ ! -d "../.git" ]] || ! command -v git >/dev/null 2>&1 ; then
- # If the folder ".git" doesn't exist or git isn't available exit the script
- exit
-fi
+#If the git command isn't available or we are not inside a git repo exit the script
+git rev-parse --git-dir > /dev/null 2>&1 || exit 1
# If this revision is after the switch to git
if (( $1 > svnrev)); then