From: "Karl Hasselström" <kha@treskal.com>
To: Catalin Marinas <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org
Subject: [StGit PATCH 5/5] Make "stg refresh" subdirectory safe
Date: Mon, 08 Oct 2007 01:25:05 +0200 [thread overview]
Message-ID: <20071007232505.13070.72826.stgit@yoghurt> (raw)
In-Reply-To: <20071007231949.13070.49517.stgit@yoghurt>
Make "stg refresh" subdirectory safe by letting it internally cd up to
the top of the worktree. This is possibly not the best long-term fix;
one could argue that the refresh subroutine should instead be safe to
run from a subdirectory. However, refreshing from a subdirectory
currently only refreshes changes that are in the index, and not
changes in the working directory, and that has to be fixed.
Signed-off-by: Karl Hasselström <kha@treskal.com>
---
stgit/commands/refresh.py | 2 +-
t/t2300-refresh-subdir.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/stgit/commands/refresh.py b/stgit/commands/refresh.py
index b283892..f032375 100644
--- a/stgit/commands/refresh.py
+++ b/stgit/commands/refresh.py
@@ -37,7 +37,7 @@ options. The '--force' option is useful when a commit object was
created with a different tool but the changes need to be included in
the current patch."""
-directory = DirectoryHasRepository()
+directory = DirectoryGotoToplevel()
options = [make_option('-f', '--force',
help = 'force the refresh even if HEAD and '\
'top differ',
diff --git a/t/t2300-refresh-subdir.sh b/t/t2300-refresh-subdir.sh
index d1c7168..bdd27c5 100755
--- a/t/t2300-refresh-subdir.sh
+++ b/t/t2300-refresh-subdir.sh
@@ -15,7 +15,7 @@ test_expect_success 'Refresh from a subdirectory' '
[ "$(stg status)" = "" ]
'
-test_expect_failure 'Refresh again' '
+test_expect_success 'Refresh again' '
echo foo2 >> foo.txt &&
echo bar2 >> bar/bar.txt &&
cd bar &&
prev parent reply other threads:[~2007-10-07 23:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-07 23:24 [StGit PATCH 0/5] Make push and refresh subdirectory safe Karl Hasselström
2007-10-07 23:24 ` [StGit PATCH 1/5] Infrastructure for current directory handling Karl Hasselström
2007-10-07 23:24 ` [StGit PATCH 2/5] New test: Try "stg push" in a subdirectory Karl Hasselström
2007-10-07 23:24 ` [StGit PATCH 3/5] Make "stg push" subdirectory safe Karl Hasselström
2007-10-07 23:25 ` [StGit PATCH 4/5] New test: try "stg refresh" in a subdirectory Karl Hasselström
2007-10-07 23:25 ` Karl Hasselström [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=20071007232505.13070.72826.stgit@yoghurt \
--to=kha@treskal.com \
--cc=catalin.marinas@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).