diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-12-05 12:52:45 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-12-05 12:52:45 -0800 |
commit | 36fd304d819d412adf1ed81d6a983dabb28bfc9b (patch) | |
tree | 7fc4343de532b086f9c3af1e04811d43ed3d6581 /builtin | |
parent | Merge branch 'sg/unpack-progress-throughput' (diff) | |
parent | rev-parse: make --show-toplevel without a worktree an error (diff) | |
download | tgif-36fd304d819d412adf1ed81d6a983dabb28bfc9b.tar.xz |
Merge branch 'jk/fail-show-toplevel-outside-working-tree'
"git rev-parse --show-toplevel" run outside of any working tree did
not error out, which has been corrected.
* jk/fail-show-toplevel-outside-working-tree:
rev-parse: make --show-toplevel without a worktree an error
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/rev-parse.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c index 85ce2095bf..7a00da8203 100644 --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@ -803,6 +803,8 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix) const char *work_tree = get_git_work_tree(); if (work_tree) puts(work_tree); + else + die("this operation must be run in a work tree"); continue; } if (!strcmp(arg, "--show-superproject-working-tree")) { |