summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1bff649)
raw | patch | inline | side by side (parent: 1bff649)
author | Linus Torvalds <torvalds@osdl.org> | |
Thu, 18 Aug 2005 22:31:40 +0000 (15:31 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 18 Aug 2005 23:26:50 +0000 (16:26 -0700) |
This makes git-applymbox verify that the index matches the current HEAD
before it starts applying patches.
Otherwise, you might have updated the index with unrelated changes, and
the first patch will commit not just the patch from the mbox, but also any
changes you had in your index.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
before it starts applying patches.
Otherwise, you might have updated the index with unrelated changes, and
the first patch will commit not just the patch from the mbox, but also any
changes you had in your index.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
tools/git-applymbox | patch | blob | history |
diff --git a/tools/git-applymbox b/tools/git-applymbox
index 889d4c1743ccdfcf8ad0be96a58eb8b60c03ccdc..afcb00a3f5e25d062eb1219994506a669e252bc5 100755 (executable)
--- a/tools/git-applymbox
+++ b/tools/git-applymbox
## use a Signoff_file, because applypatch wants to append the sign-off
## message to msg-clean every time it is run.
+. git-sh-setup-script || die "Not a git archive"
+
keep_subject= query_apply= continue= resume=t
while case "$#" in 0) break ;; esac
do
shift
esac
+files=$(git-diff-cache --cached --name-only HEAD) || exit
+if [ "$files" ]; then
+ echo "Dirty index: cannot apply patches (dirty: $files)" >&2
+ exit 1
+fi
+
case "$query_apply" in
t) touch .dotest/.query_apply
esac