From 417abfde3534ad51a1a47e00ed799e40e3f7b4ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Walle?= Date: Mon, 18 Sep 2017 19:04:29 +0200 Subject: rev-parse: rev-parse: add --is-shallow-repository MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Running `git fetch --unshallow` on a repo that is not in fact shallow produces a fatal error message. Add a helper to rev-parse that scripters can use to determine whether a repo is shallow or not. Signed-off-by: Øystein Walle Reviewed-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- Documentation/git-rev-parse.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Documentation/git-rev-parse.txt') diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt index b1293f24bb..0917b8207b 100644 --- a/Documentation/git-rev-parse.txt +++ b/Documentation/git-rev-parse.txt @@ -235,6 +235,9 @@ print a message to stderr and exit with nonzero status. --is-bare-repository:: When the repository is bare print "true", otherwise "false". +--is-shallow-repository:: + When the repository is shallow print "true", otherwise "false". + --resolve-git-dir :: Check if is a valid repository or a gitfile that points at a valid repository, and print the location of the -- cgit v1.2.3