Index: cg-pull =================================================================== --- f262000f302b749e485f5eb971e6aabefbb85680/cg-pull (mode:100755 sha1:5cd67519fc5399886f22e8758d6d34e0e3014cbb) +++ uncommitted/cg-pull (mode:100755) @@ -69,11 +69,15 @@ cp $cp_flags_l "$src" "$dest" } +u_flag="-u" + if echo "$uri" | grep -q ":"; then fetch=fetch_rsync else [ -d $uri/.git ] && uri=$uri/.git fetch=fetch_local + cp -l $uri/branches/origin .cross-device-test 2>/dev/null || u_flag="" + [ -r .cross-device-test ] && rm .cross-device-test fi @@ -95,17 +99,17 @@ [ "$rsyncerr" ] && die "unable to get the head pointer of branch $rembranch" [ -d .git/objects ] || mkdir -p .git/objects -$fetch -s -u -d "$uri/objects" ".git/objects" || die "rsync error" +$fetch -s $u_flag -d "$uri/objects" ".git/objects" || die "rsync error" # FIXME: Warn about conflicting tag names? # XXX: We now throw stderr to /dev/null since not all repositories # may have tags/ and users were confused by the harmless errors. [ -d .git/refs/tags ] || mkdir -p .git/refs/tags rsyncerr= -$fetch -s -u -d "$uri/refs/tags" ".git/refs/tags" 2>/dev/null || rsyncerr=1 +$fetch -s $u_flag -d "$uri/refs/tags" ".git/refs/tags" 2>/dev/null || rsyncerr=1 if [ "$rsyncerr" ]; then rsyncerr= - $fetch -s -u -d "$uri/tags" ".git/refs/tags" 2>/dev/null || rsyncerr=1 + $fetch -s $u_flag -d "$uri/tags" ".git/refs/tags" 2>/dev/null || rsyncerr=1 fi [ "$rsyncerr" ] && echo "unable to get tags list (non-fatal)" >&2