[PATCH] git-clone-script: store where we cloned from in .git/branches/origin

A bit more usability enhancement, while retaining Cogito
compatibility (and fixing the "-u" flag).

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano
2005-07-22 19:11:22 -07:00
committed by Linus Torvalds
parent bf0dd8a8de
commit 1cadb5a271

View File

@@ -22,10 +22,10 @@ while
0,*) break ;; 0,*) break ;;
*,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local) use_local=yes ;; *,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local) use_local=yes ;;
*,-q|*,--quiet) quiet=-q ;; *,-q|*,--quiet) quiet=-q ;;
1,-u|*,--upload-pack) usage ;; 1,-u|1,--upload-pack) usage ;;
*,-u|*,--upload-pack) *,-u|*,--upload-pack)
shift shift
upload_pack="--exec=$2" ;; upload_pack="--exec=$1" ;;
*,-*) usage ;; *,-*) usage ;;
*) break ;; *) break ;;
esac esac
@@ -81,10 +81,8 @@ yes,yes)
HEAD=HEAD HEAD=HEAD
fi fi
tar Ccf "$repo" - refs $HEAD | tar Cxf "$D/.git" - || exit 1 tar Ccf "$repo" - refs $HEAD | tar Cxf "$D/.git" - || exit 1
exit 0
;; ;;
esac *)
case "$repo" in case "$repo" in
rsync://*) rsync://*)
rsync $quiet -avz --ignore-existing "$repo/objects/" "$D/.git/objects/" && rsync $quiet -avz --ignore-existing "$repo/objects/" "$D/.git/objects/" &&
@@ -101,3 +99,10 @@ http://*)
esac esac
;; ;;
esac esac
;;
esac
# Update origin.
mkdir -p "$D/.git/branches/" &&
rm -f "$D/.git/branches/origin" &&
echo "$repo" >"$D/.git/branches/origin"