Restore `stg sink --nopush` capability
[stgit.git] / t / t0003-id.sh
blob73ab7f3924bbba7cc1e8216fec078d10aff9b34f
1 #!/bin/sh
3 test_description="Test 'stg id'"
4 . ./test-lib.sh
6 test_expect_success 'Test on uninitialized repo' '
7 stg id
10 test_expect_success 'Init repo' '
11 echo "foo" > foo.txt &&
12 git add foo.txt &&
13 git commit -m "initial" &&
14 stg init &&
15 for i in 1 2; do
16 echo "line $i" >> foo.txt &&
17 stg new -m "patch-$i" &&
18 stg refresh
19 done
22 test_expect_success 'Too many arguments' '
23 command_error stg id patch-1 patch-2 2>&1 |
24 grep -e "incorrect number of arguments"
27 test_expect_success 'Provide patch argument' '
28 test "$(echo $(stg id))" = "$(echo $(stg id $(stg top)))"
31 test_done