author | Jeff King <peff@peff.net> | |
Wed, 12 Aug 2009 03:27:40 +0000 (23:27 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 12 Aug 2009 22:50:09 +0000 (15:50 -0700) | ||
commit | 19a7fcbf16276321f83e0c1748b3935a2ea42675 | |
tree | cd608b5e2aa4ec90785e355f830bc4880ac9be61 | tree | snapshot |
parent | efd17968387482f5765a969813707629b85bf74f | commit | diff |
allow pull --rebase on branch yet to be born
When doing a "pull --rebase", we check to make sure that the index and
working tree are clean. The index-clean check compares the index against
HEAD. The test erroneously reports dirtiness if we don't have a HEAD yet.
In such an "unborn branch" case, by definition, a non-empty index won't
be based on whatever we are pulling down from the remote, and will lose
the local change. Just check if $GIT_DIR/index exists and error out.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When doing a "pull --rebase", we check to make sure that the index and
working tree are clean. The index-clean check compares the index against
HEAD. The test erroneously reports dirtiness if we don't have a HEAD yet.
In such an "unborn branch" case, by definition, a non-empty index won't
be based on whatever we are pulling down from the remote, and will lose
the local change. Just check if $GIT_DIR/index exists and error out.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-pull.sh | diff | blob | history | |
t/t5520-pull.sh | diff | blob | history |