summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6b38a40)
raw | patch | inline | side by side (parent: 6b38a40)
author | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Tue, 21 Jun 2005 22:40:00 +0000 (15:40 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Tue, 21 Jun 2005 22:40:00 +0000 (15:40 -0700) |
Both of these scripts will end up resetting the index to some specific
head, and any unresolved merge will be forgotten.
head, and any unresolved merge will be forgotten.
git-checkout-script | patch | blob | history | |
git-reset-script | patch | blob | history |
diff --git a/git-checkout-script b/git-checkout-script
index 5b49662e623a4f68f2796458daea3875911afb68..870b1a3ef9ad71699ee0a6c967e91eaab0932573 100755 (executable)
--- a/git-checkout-script
+++ b/git-checkout-script
git-checkout-cache -q -f -u -a
else
git-read-tree -m -u $old $new
-fi && [ "$branch" ] && ln -sf "refs/heads/$branch" "$GIT_DIR/HEAD"
+fi
+
+#
+# Switch the HEAD pointer to the new branch if it we
+# checked out a branch head, and remove any potential
+# old MERGE_HEAD's (subsequent commits will clearly not
+# be based on them, since we re-set the index)
+#
+if [ "$?" -eq 0 ]; then
+ [ "$branch" ] && ln -sf "refs/heads/$branch" "$GIT_DIR/HEAD"
+ rm -f "$GIT_DIR/MERGE_HEAD"
+fi
diff --git a/git-reset-script b/git-reset-script
index eaefd00d9d1e8adddb56040af0156d209815cc89..fe773388c9d55fdb87967bc04765fa94a83bf2c7 100755 (executable)
--- a/git-reset-script
+++ b/git-reset-script
#!/bin/sh
+: ${GIT_DIR=.git}
git-read-tree --reset HEAD
git-update-cache --refresh
+rm -f "$GIT_DIR/MERGE_HEAD"