git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: git@vger.kernel.org
Cc: Alexander Gladysh <agladysh@gmail.com>
Subject: [RFC/PATCH] am/pull/rebase/stash: cd_to_toplevel before require_work_tree
Date: Wed, 14 Jul 2010 14:55:21 +0200	[thread overview]
Message-ID: <96abf622ca2cf92998ce4ed393ccaa75d95dd9a8.1279112025.git.git@drmicha.warpmail.net> (raw)
In-Reply-To: <4C3DB396.2040109@drmicha.warpmail.net>

Currently, "cd_to_toplevel" comes right after "require_work_tree" for
these commands.

Put "cd_to_toplevel" before "require_work_tree" so that these commands
do not die fatally when called with --work-tree or GIT_WORK_TREE
properly set from outside of the work tree.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 git-am.sh     |    2 +-
 git-pull.sh   |    2 +-
 git-rebase.sh |    2 +-
 git-stash.sh  |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/git-am.sh b/git-am.sh
index e7f008c..bf81030 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -39,8 +39,8 @@ rebasing*       (internal use for git-rebase)"
 . git-sh-setup
 prefix=$(git rev-parse --show-prefix)
 set_reflog_action am
-require_work_tree
 cd_to_toplevel
+require_work_tree
 
 git var GIT_COMMITTER_IDENT >/dev/null ||
 	die "You need to set your committer info first"
diff --git a/git-pull.sh b/git-pull.sh
index a09a44e..83c25b9 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -10,8 +10,8 @@ SUBDIRECTORY_OK=Yes
 OPTIONS_SPEC=
 . git-sh-setup
 set_reflog_action "pull $*"
-require_work_tree
 cd_to_toplevel
+require_work_tree
 
 
 die_conflict () {
diff --git a/git-rebase.sh b/git-rebase.sh
index ab4afa7..96dd34f 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -31,8 +31,8 @@ SUBDIRECTORY_OK=Yes
 OPTIONS_SPEC=
 . git-sh-setup
 set_reflog_action rebase
-require_work_tree
 cd_to_toplevel
+require_work_tree
 
 LF='
 '
diff --git a/git-stash.sh b/git-stash.sh
index 1d95447..4564892 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -13,8 +13,8 @@ USAGE="list [<options>]
 SUBDIRECTORY_OK=Yes
 OPTIONS_SPEC=
 . git-sh-setup
-require_work_tree
 cd_to_toplevel
+require_work_tree
 
 TMP="$GIT_DIR/.git-stash.$$"
 trap 'rm -f "$TMP-*"' 0
-- 
1.7.2.rc1.212.g850a

      reply	other threads:[~2010-07-14 12:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-14  9:04 git rebase does not understand --work-tree Alexander Gladysh
2010-07-14 12:54 ` Michael J Gruber
2010-07-14 12:55   ` Michael J Gruber [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=96abf622ca2cf92998ce4ed393ccaa75d95dd9a8.1279112025.git.git@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=agladysh@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).