Git 2.2.2
[gitweb.git] / t / t9350-fast-export.sh
index 2312dec8f096fe7e36feeabd0e1cd85b5e421d4a..66c8b0a371e37f90cff8da0c92f09c8784ec45a2 100755 (executable)
@@ -504,4 +504,22 @@ test_expect_success 'refs are updated even if no commits need to be exported' '
        test_cmp expected actual
 '
 
+test_expect_success 'use refspec' '
+       git fast-export --refspec refs/heads/master:refs/heads/foobar master | \
+               grep "^commit " | sort | uniq > actual &&
+       echo "commit refs/heads/foobar" > expected &&
+       test_cmp expected actual
+'
+
+test_expect_success 'delete refspec' '
+       git branch to-delete &&
+       git fast-export --refspec :refs/heads/to-delete to-delete ^to-delete > actual &&
+       cat > expected <<-EOF &&
+       reset refs/heads/to-delete
+       from 0000000000000000000000000000000000000000
+
+       EOF
+       test_cmp expected actual
+'
+
 test_done