Documentation for the functions in git_handling.sh. A general overview is given in the project documentation.
If the pipes are not documented, the default is:
stdin
: piped input ignoredstdout
: empty
Parameters enclosed in brackets [ ] are optional.
Param. | $1 | repository path |
$2 | git command (f.ex. clone, fetch, etc.) | |
Pipes | stdout | stdout output of the executed command |
Status | the return status of the helper collection's execute_working_directory_dependant_command() |
Inspired by this SO answer
Param. | $1 | repository path |
$2 | name of the remote - defaults to origin (git 's default) if omitted | |
Pipes | stdout | URL of remote $2 of the repository at $1 |
Status | 0 | success, URL written on stdout |
1 | path $1 doesn't exist | |
2 | path $1 is not a folder | |
3 | no read permission on path $1 | |
4 | folder $1 doesn't seem to be a git repository (no ./.git folder inside) | |
5 | git config call failed | |
6 | $1 is empty |
Default messages:
Status | Template |
---|---|
0 | $1 cloned to $2 \n |
1 | Git clone error: could not clone $1 to $2 \n |
2 | $1 already cloned to $2 - nothing to do\n |
3 | $2 exists and it's not a folder\n |
4 | $2 exists but it's not readable\n |
5 | $2 exist but it doesn't seem to be a git repository (no .git folder inside)\n |
6 | $2 exists but the attempt to run git config to get the remote URL failed\n |
7 | $2 exists and it's a git repository but the remote URL is not $1\n |
8 | Repository URL is empty\n |
9 | Repository path empty\n |
Param. | $1 | repository URL |
$2 | path to clone to | |
[$3 ] | stdout configuration:
| |
Pipes | stdout | if $3 is non-empty, the message |
Status | 0 | git clone suceeded |
1 | git clone failed | |
2 | $1 already cloned to $2 | |
3 | $2 exists but it's not a folder | |
4 | $2 is not readable | |
5 | $2 exists but it doesn't seem to be a repository | |
6 | $2 seems to be a repository but the attempt to run git config failed | |
7 | $2 exists but it has another URL than $1 | |
8 | $1 emtpy | |
9 | $2 empty |