summaryrefslogtreecommitdiff
path: root/pbs-package-merge
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-03-16 18:44:44 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-03-16 18:44:44 -0400
commitab8423d3cdf52bf86589498107f59470868301f1 (patch)
treeb9f74db0760f605648bdf787be9caa97acb46881 /pbs-package-merge
parentd6738c9a5ad3b25013d4788ea4e847abdaa06ce9 (diff)
Use `git rev-parse` to more flexibly handle directories
Diffstat (limited to 'pbs-package-merge')
-rwxr-xr-xpbs-package-merge8
1 files changed, 6 insertions, 2 deletions
diff --git a/pbs-package-merge b/pbs-package-merge
index b0fafc9..f99484b 100755
--- a/pbs-package-merge
+++ b/pbs-package-merge
@@ -27,11 +27,15 @@ main() {
return 1
fi
- if [[ ! -f .git ]]; then
- error "Must be in a package directory"
+ if ! git rev-parse --git-dir &>/dev/null; then
+ error "Must be in a package (git) directory"
+ return 1
fi
+ cd "$(git rev-parse --show-cdup)"
+
if [[ ! -r pbstrack ]]; then
error "No pbstrack file found, don't know where to pull from"
+ return 1
fi
git pull $(cat pbstrack)
}