<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -102,7 +102,7 @@ esac
 if [ -z &quot;$prefix&quot; ]; then
 	die &quot;You must provide the --prefix option.&quot;
 fi
-dir=&quot;$prefix&quot;
+dir=&quot;$(dirname &quot;$prefix/.&quot;)&quot;
 
 if [ &quot;$command&quot; != &quot;pull&quot; ]; then
 	revs=$(git rev-parse $default --revs-only &quot;$@&quot;) || exit $?
@@ -175,7 +175,7 @@ find_latest_squash()
 	sq=
 	main=
 	sub=
-	git log --grep=&quot;^git-subtree-dir: $dir\$&quot; \
+	git log --grep=&quot;^git-subtree-dir: $dir/*\$&quot; \
 		--pretty=format:'START %H%n%s%n%n%b%nEND%n' HEAD |
 	while read a b junk; do
 		debug &quot;$a $b $junk&quot;
@@ -210,7 +210,7 @@ find_existing_splits()
 	revs=&quot;$2&quot;
 	main=
 	sub=
-	git log --grep=&quot;^git-subtree-dir: $dir\$&quot; \
+	git log --grep=&quot;^git-subtree-dir: $dir/*\$&quot; \
 		--pretty=format:'START %H%n%s%n%n%b%nEND%n' $revs |
 	while read a b junk; do
 		case &quot;$a&quot; in</diff>
      <filename>git-subtree.sh</filename>
    </modified>
    <modified>
      <diff>@@ -82,7 +82,7 @@ git branch subdir
 
 git fetch ../subproj sub1
 git branch sub1 FETCH_HEAD
-git subtree add --prefix=subdir FETCH_HEAD
+git subtree add --prefix=subdir/ FETCH_HEAD
 
 # this shouldn't actually do anything, since FETCH_HEAD is already a parent
 git merge -m 'merge -s -ours' -s ours FETCH_HEAD
@@ -118,7 +118,7 @@ create sub9
 git commit -m 'sub9'
 
 cd ../mainline
-split2=$(git subtree split --annotate='*' --prefix subdir --rejoin)
+split2=$(git subtree split --annotate='*' --prefix subdir/ --rejoin)
 git branch split2 &quot;$split2&quot;
 
 create subdir/main-sub10</diff>
      <filename>test.sh</filename>
    </modified>
    <modified>
      <diff>@@ -36,10 +36,6 @@
 		one of the other git tools that git-subtree calls.  Should
 		detect this situation and print the *real* problem.
 	
-	In fact, the prefix should *not* end with slash, and we
-		should detect (and fix) it if it does.  Otherwise the
-		log message looks weird.
-		
 	&quot;pull --squash&quot; should do fetch-synthesize-merge, but instead just
 		does &quot;pull&quot; directly, which doesn't work at all.
 </diff>
      <filename>todo</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>39ee6ecf7ed8b3c6a5c8ed24f825211f3b920f76</id>
    </parent>
  </parents>
  <author>
    <name>Avery Pennarun</name>
    <email>apenwarr@gmail.com</email>
  </author>
  <url>http://github.com/apenwarr/git-subtree/commit/6f2012cdc021f6b47ed19bc7fe64159ce9eeda8a</url>
  <id>6f2012cdc021f6b47ed19bc7fe64159ce9eeda8a</id>
  <committed-date>2009-10-02T13:08:58-07:00</committed-date>
  <authored-date>2009-10-02T12:22:15-07:00</authored-date>
  <message>If someone provides a --prefix that ends with slash, strip the slash.

Prefixes that differ only in the trailing slash should be considered
identical.

Also update the test to check that this works.</message>
  <tree>1c3fdb6d87802b71bb23d7a4786aee8252e0faea</tree>
  <committer>
    <name>Avery Pennarun</name>
    <email>apenwarr@gmail.com</email>
  </committer>
</commit>
