1#!/bin/sh
   2#
   3# Copyright (c) 2006 Catalin Marinas
   4#
   5test_description='git-apply trying to add an ending line.
   7'
   9. ./test-lib.sh
  10# setup
  12cat >test-patch <<\EOF
  14diff --git a/file b/file
  15--- a/file
  16+++ b/file
  17@@ -1,2 +1,3 @@
  18 a
  19 b
  20+c
  21EOF
  22echo 'a' >file
  24echo 'b' >>file
  25echo 'c' >>file
  26test_expect_success setup \
  28    'git-update-index --add file'
  29# test
  31test_expect_failure 'apply at the end' \
  33    'git-apply --index test-patch'
  34cat >test-patch <<\EOF
  36diff a/file b/file
  37--- a/file
  38+++ b/file
  39@@ -1,2 +1,3 @@
  40+a
  41 b
  42 c
  43EOF
  44echo >file 'a
  46b
  47c'
  48git-update-index file
  49test_expect_failure 'apply at the beginning' \
  51        'git-apply --index test-patch'
  52test_done