commit - fab625edcf5515d05f0e464777bca94a399d3dec
commit + e68d855946d9c32185381174abd4cf13b733a49f
blob - 562e7d042f4ea2940fa994c38d2bca173b307eef
blob + f70cd33f2fc7d3ec872405de6c75ceea2064cb7c
--- got-archive
+++ got-archive
if [ "$branch" ]; then
cname="$name-$ver"
- got checkout -q -c "$branch" "$repo" "$tmpdir/$cname" || die 3 "Error: failed to checkout"
+ cdir="$tmpdir/$cname"
+ rm -rf "$cdir"
+ got checkout -q -c "$branch" "$repo" "$cdir" || die 3 "Error: failed to checkout"
else
cname="$name"
- got checkout -q "$repo" "$tmpdir/$cname" || die 3 "Error: failed to checkout"
+ cdir="$tmpdir/$cname"
+ rm -rf "$cdir"
+ got checkout -q "$repo" "$cdir" || die 3 "Error: failed to checkout"
fi
-rm -rf "$tmpdir/$cname/.got"
+rm -rf "$cdir/.got"
tar -czf "$outdir/$cname.tgz" -C "$tmpdir" "$cname" || die 4 "Error: failed to create tarball"
-rm -rf "$tmpdir/$cname"
+rm -rf "$cdir"