aboutsummaryrefslogtreecommitdiff
path: root/git-pull.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2008-05-21 12:32:16 +0100
committerJunio C Hamano <gitster@pobox.com>2008-05-22 23:05:11 -0700
commitf9189cf8f2427b10a40b5b3e530e2c893bc64ae9 (patch)
tree613f4df13029d7c2b0f54a290969f79858438dbe /git-pull.sh
parentdee2775a29440ca8a52bb5bd09a6de6cd29f69cc (diff)
downloadgit-f9189cf8f2427b10a40b5b3e530e2c893bc64ae9.tar.gz
git-f9189cf8f2427b10a40b5b3e530e2c893bc64ae9.tar.xz
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 'git-pull.sh')
-rwxr-xr-xgit-pull.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/git-pull.sh b/git-pull.sh
index bf0c2985a..809e537a4 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -107,6 +107,11 @@ error_on_no_merge_candidates () {
}
test true = "$rebase" && {
+ git update-index --refresh &&
+ git diff-files --quiet &&
+ git diff-index --cached --quiet HEAD -- ||
+ die "refusing to pull with rebase: your working tree is not up-to-date"
+
. git-parse-remote &&
origin="$1"
test -z "$origin" && origin=$(get_default_remote)