summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 33aaa69)
raw | patch | inline | side by side (parent: 33aaa69)
author | Avery Pennarun <apenwarr@gmail.com> | |
Wed, 26 Aug 2009 14:43:43 +0000 (10:43 -0400) | ||
committer | Avery Pennarun <apenwarr@gmail.com> | |
Wed, 26 Aug 2009 14:45:13 +0000 (10:45 -0400) |
We were trying to 'git checkout $prefix', which is ambiguous if $prefix
names a directory *and* a branch. Do 'git checkout -- $prefix' instead.
The main place this appeared was in 'git subtree add'.
Reported by several people.
names a directory *and* a branch. Do 'git checkout -- $prefix' instead.
The main place this appeared was in 'git subtree add'.
Reported by several people.
git-subtree.sh | patch | blob | history | |
test.sh | patch | blob | history | |
todo | patch | blob | history |
diff --git a/git-subtree.sh b/git-subtree.sh
index f7d2fe408dfda272f4b3dd2327d013f2ac6ef7fc..b7c741cfd43ef7501502f7be64174b0fd8385c7c 100755 (executable)
--- a/git-subtree.sh
+++ b/git-subtree.sh
debug "Adding $dir as '$rev'..."
git read-tree --prefix="$dir" $rev || exit $?
- git checkout "$dir" || exit $?
+ git checkout -- "$dir" || exit $?
tree=$(git write-tree) || exit $?
headrev=$(git rev-parse HEAD) || exit $?
index 8283fadaad669bdf4ead0d988abc0f97e0edc1c2..bed7f2790629a76d9ec58bf8cca5b51619dd2ef5 100755 (executable)
--- a/test.sh
+++ b/test.sh
create main4
git commit -m 'main4'
git branch -m master mainline
+git branch subdir
git fetch ../subproj sub1
git branch sub1 FETCH_HEAD
index 3040b9f17185dd8fe8b67d55f1aa7380d9e2b673..5e72b2e5100bccbf820cf47269d8a66009d0a74f 100644 (file)
--- a/todo
+++ b/todo
automated tests for --squash stuff
- test.sh fails in msysgit?
- sort error - see Thell's email
-
"add" command non-obviously requires a commitid; would be easier if
it had a "pull" sort of mode instead
should detect (and fix) it if it does. Otherwise the
log message looks weird.
- totally weird behavior in 'git subtree add' if --prefix matches
- a branch name
-
"pull --squash" should do fetch-synthesize-merge, but instead just
does "pull" directly, which doesn't work at all.