summaryrefslogtreecommitdiff
path: root/t/t5520-pull.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2008-05-21 11:32:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-05-23 06:05:11 (GMT)
commitf9189cf8f2427b10a40b5b3e530e2c893bc64ae9 (patch)
tree613f4df13029d7c2b0f54a290969f79858438dbe /t/t5520-pull.sh
parentdee2775a29440ca8a52bb5bd09a6de6cd29f69cc (diff)
downloadgit-f9189cf8f2427b10a40b5b3e530e2c893bc64ae9.zip
git-f9189cf8f2427b10a40b5b3e530e2c893bc64ae9.tar.gz
git-f9189cf8f2427b10a40b5b3e530e2c893bc64ae9.tar.bz2
pull --rebase: exit early when the working directory is dirty
When rebasing fails during "pull --rebase", you cannot just clean up the working directory and call "pull --rebase" again, since the remote branch was already fetched. Therefore, die early when the working directory is dirty. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5520-pull.sh')
-rwxr-xr-xt/t5520-pull.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index 9484129..997b2db 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -92,4 +92,22 @@ test_expect_success '--rebase with rebased upstream' '
'
+test_expect_success 'pull --rebase dies early with dirty working directory' '
+
+ git update-ref refs/remotes/me/copy copy^ &&
+ COPY=$(git rev-parse --verify me/copy) &&
+ git rebase --onto $COPY copy &&
+ git config branch.to-rebase.remote me &&
+ git config branch.to-rebase.merge refs/heads/copy &&
+ git config branch.to-rebase.rebase true &&
+ echo dirty >> file &&
+ git add file &&
+ test_must_fail git pull &&
+ test $COPY = $(git rev-parse --verify me/copy) &&
+ git checkout HEAD -- file &&
+ git pull &&
+ test $COPY != $(git rev-parse --verify me/copy)
+
+'
+
test_done