← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:makefile-quiet-if-no-git into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:makefile-quiet-if-no-git into launchpad:master.

Commit message:
Quieten Makefile when there's no .git directory

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/453246

This is the case when deploying one of Launchpad's charms.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:makefile-quiet-if-no-git into launchpad:master.
diff --git a/Makefile b/Makefile
index 7e5c4c2..7bb06c0 100644
--- a/Makefile
+++ b/Makefile
@@ -91,8 +91,8 @@ PIP_BIN = \
 # XXX cjwatson 2023-04-11: Should be "git branch --show-current", but
 # xenial's git doesn't support that.  Use the more concise form once we
 # require focal.
-GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
-TARBALL_REVISION ?= $(shell git rev-parse HEAD)
+GIT_BRANCH := $(shell if [ -d .git ]; then git rev-parse --abbrev-ref HEAD; fi)
+TARBALL_REVISION ?= $(shell if [ -d .git ]; then git rev-parse HEAD; fi)
 ifeq ($(GIT_BRANCH),db-devel)
 TARBALL_SUFFIX := db
 else