diff options
author | Benoit Sigoure <tsuna@lrde.epita.fr> | 2007-10-16 16:36:50 +0200 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2007-10-17 02:47:37 -0400 |
commit | 151534515682695348a8172f399f4bf025154a5f (patch) | |
tree | 316fabc58bc4a4704526b2a7db0400efd5f022fe /t/t9101-git-svn-props.sh | |
parent | d05ddec51e4e23923f8f6c633f0a125c9a27a391 (diff) | |
download | git-151534515682695348a8172f399f4bf025154a5f.tar.gz git-151534515682695348a8172f399f4bf025154a5f.tar.xz |
git-svn: add git svn propget
This allows one to easily retrieve a single SVN property from within
git-svn without requiring svn or remembering the URL of a repository
* git-svn.perl (%cmd): Add the new command `propget'.
($cmd_dir_prefix): New global.
(&get_svnprops): New helper.
(&cmd_propget): New. Use &get_svnprops.
* t/t9101-git-svn-props.sh: Add a test case for propget.
[ew: make sure the rev-parse --show-prefix call doesn't break
the `git-svn clone' command]
Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 't/t9101-git-svn-props.sh')
-rwxr-xr-x | t/t9101-git-svn-props.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh index 796d80e90..61c879959 100755 --- a/t/t9101-git-svn-props.sh +++ b/t/t9101-git-svn-props.sh @@ -170,4 +170,27 @@ test_expect_success 'test create-ignore' " git ls-files -s | grep gitignore | cmp - create-ignore-index.expect " +cat >prop.expect <<\EOF +no-such-file* + +EOF +cat >prop2.expect <<\EOF +8 +EOF + +# This test can be improved: since all the svn:ignore contain the same +# pattern, it can pass even though the propget did not execute on the +# right directory. +test_expect_success 'test propget' " + git-svn propget svn:ignore . | cmp - prop.expect && + cd deeply && + git-svn propget svn:ignore . | cmp - ../prop.expect && + git-svn propget svn:entry:committed-rev nested/directory/.keep \ + | cmp - ../prop2.expect && + git-svn propget svn:ignore .. | cmp - ../prop.expect && + git-svn propget svn:ignore nested/ | cmp - ../prop.expect && + git-svn propget svn:ignore ./nested | cmp - ../prop.expect && + git-svn propget svn:ignore .././deeply/nested | cmp - ../prop.expect + " + test_done |