chiark / gitweb /
Merge branch 'fixes/independent-help' into refs/top-bases/i/basis-merge
[topgit.git] / tg-export.sh
index 5f7330b897baf54cf59922ec2939513ead231de9..d68a6acd6d7286fabb1e59fde256dea29283d0f1 100644 (file)
@@ -63,22 +63,11 @@ fi
 # $name is equal to the last of the list of branches
 
 
-playground="$(mktemp -d -t tg-export.XXXXXX)"
-trap 'rm -rf "$playground"' EXIT
+playground="$(get_temp tg-export -d)"
 
 
 ## Collapse driver
 
-# pretty_tree NAME
-# Output tree ID of a cleaned-up tree without tg's artifacts.
-pretty_tree()
-{
-       (export GIT_INDEX_FILE="$playground/^index"
-        git read-tree "$1"
-        git update-index --force-remove ".topmsg" ".topdeps"
-        git write-tree)
-}
-
 create_tg_commit()
 {
        name="$1"
@@ -119,7 +108,7 @@ collapsed_commit()
                        echo "TopGit-driven merge of branches:"
                        echo
                        cut -f 2 "$playground/$name^parents"
-               } | git commit-tree "$(pretty_tree "refs/top-bases/$name")" \
+               } | git commit-tree "$(pretty_tree "$name" -b)" \
                        $(for p in $parent; do echo -p $p; done))"
        fi
 
@@ -234,7 +223,7 @@ linearize()
        else
                retmerge=0;
 
-               git merge-recursive "$(pretty_tree "refs/top-bases/$_dep")" -- HEAD "$(pretty_tree "refs/heads/$_dep")" || retmerge="$?";
+               git merge-recursive "$(pretty_tree "$_dep" -b)" -- HEAD "$(pretty_tree "refs/heads/$_dep")" || retmerge="$?";
 
                if test "x$retmerge" != "x0"; then
                        git rerere;