Skip to content

Instantly share code, notes, and snippets.

/out.txt Secret

Created July 15, 2015 19:04
Show Gist options
  • Save anonymous/c92772afd74d5850ccf4 to your computer and use it in GitHub Desktop.
Save anonymous/c92772afd74d5850ccf4 to your computer and use it in GitHub Desktop.
+ cat ./init-test
#!/bin/bash
set -ex
cat $0 # Show this script in the output
REPO=${1:-ingydotnet/djson-pm}
REPODIR="${REPO#*/}"
SUBDIR=${2:-test}
SUBREPO=$REPO-$SUBDIR
SUBREPODIR="${SUBREPO#*/}"
git hub repo-delete "$SUBREPO" || true
rm -fr "$REPODIR"
git hub clone "$REPO"
(
cd "$REPODIR"
git subrepo init test -r "git@github.com:$SUBREPO" # -b foo
git hub repo-new "$SUBREPO"
git hub repo "$SUBREPO"
cat "$SUBDIR/.gitrepo"
git subrepo push "$SUBDIR"
git subrepo status "$SUBDIR"
git hub clone "$SUBREPO"
[[ -e "$SUBREPODIR/decode.t" ]] && echo PASS || echo FAIL
)
+ REPO=ingydotnet/djson-pm
+ REPODIR=djson-pm
+ SUBDIR=test
+ SUBREPO=ingydotnet/djson-pm-test
+ SUBREPODIR=djson-pm-test
+ git hub repo-delete ingydotnet/djson-pm-test
Repository 'ingydotnet/djson-pm-test' deleted
+ rm -fr djson-pm
+ git hub clone ingydotnet/djson-pm
Cloning into 'djson-pm'...
ingydotnet/djson-pm cloned
+ cd djson-pm
+ git subrepo init test -r git@github.com:ingydotnet/djson-pm-test
Subrepo created from 'test' with remote 'git@github.com:ingydotnet/djson-pm-test' (master).
+ git hub repo-new ingydotnet/djson-pm-test
Repository 'git@github.com:ingydotnet/djson-pm-test' created.
+ git hub repo ingydotnet/djson-pm-test
Full Name ingydotnet/djson-pm-test
GitHub Page https://github.com/ingydotnet/djson-pm-test
Remote URL git@github.com:ingydotnet/djson-pm-test.git
Forks 0
Stars 0
Open Issues 0
Pushed At 2015-07-15 19:04:27
Created At 2015-07-15
+ cat test/.gitrepo
; DO NOT EDIT (unless you know what you are doing)
;
; This subdirectory is a git "subrepo", and this file is maintained by the
; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
;
[subrepo]
remote = git@github.com:ingydotnet/djson-pm-test
branch = master
commit = 181642ed561296fcce62d480d2daf178c33c2c6b
parent = cca3ea509875a7c188089a3700ef4b9f9d81b4c9
cmdver = 0.2.2
+ git subrepo push test
Subrepo 'test' pushed to 'git@github.com:ingydotnet/djson-pm-test' (master).
+ git subrepo status test
Git subrepo 'test':
Remote URL: git@github.com:ingydotnet/djson-pm-test
Tracking Branch: master
Pulled Commit: 181642e
Pull Parent: cca3ea5
+ git hub clone ingydotnet/djson-pm-test
Cloning into 'djson-pm-test'...
ingydotnet/djson-pm-test cloned
+ [[ -e djson-pm-test/decode.t ]]
+ echo PASS
PASS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment