t / t9105-git-svn-commit-diff.shon commit git-svn: rename 'commit' command to 'set-tree' (3289e86)
   1#!/bin/sh
   2#
   3# Copyright (c) 2006 Eric Wong
   4test_description='git-svn commit-diff'
   5. ./lib-git-svn.sh
   6
   7test_expect_success 'initialize repo' "
   8        mkdir import &&
   9        cd import &&
  10        echo hello > readme &&
  11        svn import -m 'initial' . $svnrepo &&
  12        cd .. &&
  13        echo hello > readme &&
  14        git update-index --add readme &&
  15        git commit -a -m 'initial' &&
  16        echo world >> readme &&
  17        git commit -a -m 'another'
  18        "
  19
  20head=`git rev-parse --verify HEAD^0`
  21prev=`git rev-parse --verify HEAD^1`
  22
  23# the internals of the commit-diff command are the same as the regular
  24# commit, so only a basic test of functionality is needed since we've
  25# already tested commit extensively elsewhere
  26
  27test_expect_success 'test the commit-diff command' "
  28        test -n '$prev' && test -n '$head' &&
  29        git-svn commit-diff -r1 '$prev' '$head' '$svnrepo' &&
  30        svn co $svnrepo wc &&
  31        cmp readme wc/readme
  32        "
  33
  34test_done