summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 64586e7)
raw | patch | inline | side by side (parent: 64586e7)
author | Junio C Hamano <gitster@pobox.com> | |
Fri, 14 Sep 2007 23:53:58 +0000 (16:53 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 18 Sep 2007 06:57:35 +0000 (23:57 -0700) |
Because a partial commit is meant to be a way to ignore what are
staged in the index, "git rm --cached A && git commit A" should
just record what is in A on the filesystem. The previous patch
made the command sequence to barf, saying that A has not been
added yet. This fixes it.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
staged in the index, "git rm --cached A && git commit A" should
just record what is in A on the filesystem. The previous patch
made the command sequence to barf, saying that A has not been
added yet. This fixes it.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-commit.sh | patch | blob | history | |
t/t7501-commit.sh | patch | blob | history |
diff --git a/git-commit.sh b/git-commit.sh
index 5ea3fd00768dbb5e27ee1b8b9f3285ee35640021..bb113e858b73945a1c637024277415cc5ad8f436 100755 (executable)
--- a/git-commit.sh
+++ b/git-commit.sh
(
GIT_INDEX_FILE="$NEXT_INDEX"
export GIT_INDEX_FILE
- git update-index --remove --stdin
+ git update-index --add --remove --stdin
) || exit
;;
esac
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index f178f56208ce84c273fd251c4420a7b6f86c3c86..b151b51a3420fdba921da16979ec4a480b61a973 100644 (file)
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
'validate git-rev-list output.' \
'diff current expected'
-test_expect_success 'partial commit that involve removal (1)' '
+test_expect_success 'partial commit that involves removal (1)' '
git rm --cached file &&
mv file elif &&
'
-test_expect_success 'partial commit that involve removal (2)' '
+test_expect_success 'partial commit that involves removal (2)' '
git commit -m "Partial: remove file" file &&
git diff-tree --name-status HEAD^ HEAD >current &&
'
+test_expect_success 'partial commit that involves removal (3)' '
+
+ git rm --cached elif &&
+ echo elif >elif &&
+ git commit -m "Partial: modify elif" elif &&
+ git diff-tree --name-status HEAD^ HEAD >current &&
+ echo "M elif" >expected &&
+ diff expected current
+
+'
+
test_done