chiark / gitweb /
Make "stg refresh" subdirectory safe
[stgit] / t / t2300-refresh-subdir.sh
CommitLineData
78384a2c
KH
1#!/bin/sh
2test_description='Test the refresh command from a subdirectory'
3. ./test-lib.sh
4stg init
5
6test_expect_success 'Refresh from a subdirectory' '
7 stg new foo -m foo &&
8 echo foo >> foo.txt &&
9 mkdir bar &&
10 echo bar >> bar/bar.txt &&
11 stg add foo.txt bar/bar.txt &&
12 cd bar &&
13 stg refresh &&
14 cd .. &&
15 [ "$(stg status)" = "" ]
16'
17
2299c463 18test_expect_success 'Refresh again' '
78384a2c
KH
19 echo foo2 >> foo.txt &&
20 echo bar2 >> bar/bar.txt &&
21 cd bar &&
22 stg refresh &&
23 cd .. &&
24 [ "$(stg status)" = "" ]
25'
26
27test_done