summaryrefslogtreecommitdiffstats
path: root/acid/acid-source
diff options
context:
space:
mode:
Diffstat (limited to 'acid/acid-source')
-rwxr-xr-xacid/acid-source13
1 files changed, 7 insertions, 6 deletions
diff --git a/acid/acid-source b/acid/acid-source
index 8242452..d03076f 100755
--- a/acid/acid-source
+++ b/acid/acid-source
@@ -6,21 +6,22 @@
# <name> doesn't exist. If updates are found, we attempt to checkout the newest
# version according to <ref-pattern> (see <pattern> from git-for-each-ref(1)).
#
-# On a successful run, the new object hash is printed to stdout (or the previous
-# hash, if no update occurred). This may be a commit hash. However, if
-# <ref-pattern> matches an annotated tag, then the hash refers to the tag object.
-# The caller should cache this hash value upon successful deployment.
+# On a successful run, the new commit hash is printed to stdout (or the previous
+# hash, if no update occurred). The caller should cache this hash value upon
+# successful deployment.
#
# If a new version of the file tree is checked out, this file exits with code 1,
# otherwise a stale success exits with 0. On any error, the null hash is
# printed, and we exit with 2.
gethash() {
- git for-each-ref \
+ obj=$(git for-each-ref \
--count=1 \
--format='%(objectname)' \
--sort='-creatordate' \
- "$1" # pattern
+ "$1") # pattern
+
+ git rev-parse --quiet --verify "$obj^{commit}"
}
fail() {