summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e2eb527)
raw | patch | inline | side by side (parent: e2eb527)
author | Jeff King <peff@peff.net> | |
Thu, 13 Oct 2011 15:59:24 +0000 (11:59 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 13 Oct 2011 19:16:36 +0000 (12:16 -0700) |
You can't currently run git-pull or git-rebase from outside
of the work tree, even with GIT_WORK_TREE set, due to an
overeager require_work_tree function. Commit e2eb527
documents this problem and provides the infrastructure for a
fix, but left it to later commits to audit and update
individual scripts.
Changing these scripts to use require_work_tree_exists is
easy to verify. We immediately call cd_to_toplevel, anyway.
Therefore no matter which function we use, the state
afterwards is one of:
1. We have a work tree, and we are at the top level.
2. We don't have a work tree, and we have died.
The only catch is that we must also make sure no code that
ran before the cd_to_toplevel assumed that we were already
in the working tree.
In this case, we will only have included shell libraries and
called set_reflog_action, neither of which care about the
current working directory at all.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
of the work tree, even with GIT_WORK_TREE set, due to an
overeager require_work_tree function. Commit e2eb527
documents this problem and provides the infrastructure for a
fix, but left it to later commits to audit and update
individual scripts.
Changing these scripts to use require_work_tree_exists is
easy to verify. We immediately call cd_to_toplevel, anyway.
Therefore no matter which function we use, the state
afterwards is one of:
1. We have a work tree, and we are at the top level.
2. We don't have a work tree, and we have died.
The only catch is that we must also make sure no code that
ran before the cd_to_toplevel assumed that we were already
in the working tree.
In this case, we will only have included shell libraries and
called set_reflog_action, neither of which care about the
current working directory at all.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-pull.sh | patch | blob | history | |
git-rebase.sh | patch | blob | history |
diff --git a/git-pull.sh b/git-pull.sh
index eb87f49062b70d707adebca4013809822123608b..7500b58ff9a9d7f4bec58c4bd27345dff7b57d29 100755 (executable)
--- a/git-pull.sh
+++ b/git-pull.sh
OPTIONS_SPEC=
. git-sh-setup
set_reflog_action "pull $*"
-require_work_tree
+require_work_tree_exists
cd_to_toplevel
diff --git a/git-rebase.sh b/git-rebase.sh
index cbb0ea90ed410d5af68ce814b7fd93a90829f3ee..60a405d1fb70b4c8af3ee771a48ea006bd268e4d 100755 (executable)
--- a/git-rebase.sh
+++ b/git-rebase.sh
OPTIONS_SPEC=
. git-sh-setup
set_reflog_action rebase
-require_work_tree
+require_work_tree_exists
cd_to_toplevel
LF='