It converts commitids directly into trees and cats the entire tree
recursively.
If no ids are provided on the command line, it reverts back to reading the
list of objects from stdin.
diff -u tags1 tags2 || true
wc -c testfile1 testfile2
wc -l tags1 tags2
- ./bup join <tags1 >out1
+ ./bup join $$(cat tags1) >out1
./bup join <tags2 >out2
diff -u testfile1 out1
diff -u testfile2 out2
{
local typ="$1"
local sha="$2"
- if [ "$typ" = "tree" ]; then
- git cat-file -p "$x" | while read nmode ntyp nsha njunk; do
+ if [ "$typ" = "tree" -o "$typ" = "commit" ]; then
+ git cat-file -p "$x:" | while read nmode ntyp nsha njunk; do
get_one $ntyp $nsha
done
else
fi
}
-while read x junk; do
- typ="$(git cat-file -t "$x")"
- get_one "$typ" "$x"
-done
+
+get_from_stdin()
+{
+ while read x junk; do
+ [ -z "$x" ] && continue
+ typ="$(git cat-file -t "$x")"
+ get_one "$typ" "$x"
+ done
+}
+
+
+if [ -z "$*" ]; then
+ get_from_stdin
+else
+ for d in "$@"; do
+ echo "$d"
+ done | get_from_stdin
+fi