summaryrefslogtreecommitdiff
path: root/git-subtree.sh
diff options
context:
space:
mode:
authorLibravatar Avery Pennarun <apenwarr@gmail.com>2009-04-24 14:52:27 -0400
committerLibravatar Avery Pennarun <apenwarr@gmail.com>2009-04-24 14:52:27 -0400
commite25a6bf837ba378b0a8264e580c61069951dce66 (patch)
treef90b605b21503c4326fc94e7363b581ab110fc8f /git-subtree.sh
parentWe now copy the other stuff about a commit (changelog, author, etc). (diff)
downloadtgif-e25a6bf837ba378b0a8264e580c61069951dce66.tar.xz
Print out the newly created commitid at the end, for use in other scripts.
Diffstat (limited to 'git-subtree.sh')
-rwxr-xr-xgit-subtree.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/git-subtree.sh b/git-subtree.sh
index 256946b0de..5f8b0f6c59 100755
--- a/git-subtree.sh
+++ b/git-subtree.sh
@@ -93,7 +93,7 @@ cache_set()
{
oldrev="$1"
newrev="$2"
- if [ -e "$cachedir/$oldrev" ]; then
+ if [ "$oldrev" != "latest" -a -e "$cachedir/$oldrev" ]; then
die "cache for $oldrev already exists!"
fi
echo "$newrev" >"$cachedir/$oldrev"
@@ -140,9 +140,14 @@ cmd_split()
newrev=$(copy_commit $rev $tree "$p") || exit $?
debug " newrev is: $newrev"
cache_set $rev $newrev
+ cache_set latest $newrev
done || exit $?
done || exit $?
-
+ latest=$(cache_get latest)
+ if [ -z "$latest" ]; then
+ die "No new revisions were found"
+ fi
+ echo $latest
exit 0
}