chiark / gitweb /
Merge branch 'stable'
authorCatalin Marinas <catalin.marinas@gmail.com>
Tue, 9 Sep 2008 22:12:19 +0000 (23:12 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Tue, 9 Sep 2008 22:12:19 +0000 (23:12 +0100)
stgit/commands/imprt.py
t/t1800-import.sh

index e649ed7c632ba15a72533f6b52130148d2db606e..5fc83e935d241f1ad00a26b74447cb5337defd62 100644 (file)
@@ -301,6 +301,10 @@ def func(parser, options, args):
     else:
         filename = None
 
+    if filename:
+        filename = os.path.abspath(filename)
+    directory.cd_to_topdir()
+
     if options.series:
         __import_series(filename, options)
     elif options.mbox:
index 1352743ddb498d2784361682a9b32a661bebdb43..9c317411f0dc2aaead640031850d4c4b9cafb57c 100755 (executable)
@@ -21,6 +21,17 @@ test_expect_success \
     stg delete ..
     '
 
+test_expect_success \
+    'Apply a patch created with "git diff" from a subdirectory' \
+    '
+    mkdir subdir && cd subdir &&
+    stg import ../../t1800-import/git-diff &&
+    [ $(git cat-file -p $(stg id) \
+        | grep -c "tree e96b1fba2160890ff600b675d7140d46b022b155") = 1 ] &&
+    stg delete .. &&
+    cd ..
+    '
+
 test_expect_success \
     'Apply a patch created with GNU diff' \
     '