diff --git a/README.mkd b/README.mkd index a8116d7..3efc820 100644 --- a/README.mkd +++ b/README.mkd @@ -203,7 +203,7 @@ You can also specify a local directory on your file system as a bundle. In this case, make sure the path you give is the absolute path (i.e., starts with a `/`). Relative paths are not supported. If the repo you gave is a local directory path, then it is not necessary that this path is a git repo. Please -refer to the notes on `--no-local-repo` below. +refer to the notes on `--no-local-clone` below. In addition to the above discussed arguments, `antigen-bundle` also takes a `btype` keyword-only argument, that is used internally. You shouldn't be @@ -238,8 +238,10 @@ creating a clone. For example, antigen-bundle /absolute/path/to/the/plugin --no-local-clone -Note that if the repo url is *not* an absolute local path, this argument has no -effect. +Note that if the repo url is *not* an absolute local path or a branch has been +specified with the `--branch` option, this argument has no effect. That is, +for this option to have any affect, the repo url must be an absolute local path +and no `--branch` should be specified. Also, if the local path given as the url is not a git repo, then this argument is forced as it doesn't makes sense to *clone* something that's not a diff --git a/antigen.zsh b/antigen.zsh index 6686da8..90c86d0 100644 --- a/antigen.zsh +++ b/antigen.zsh @@ -66,10 +66,13 @@ antigen-bundle () { fi # The `make_local_clone` variable better represents whether there should be - # a local clone made. If the url is a local absolute path and no_local_clone - # is true, then and only then, there should be no cloning taking place. + # a local clone made. For cloning to be avoided, firstly, the `$url` should + # be an absolute local path and `$branch` should be empty. In addition to + # these two conditions, either the `--no-local-clone` option should be + # given, or `$url` should not a git repo. local make_local_clone=true - if [[ $url == /* && ( $no_local_clone == true || ! -d $url/.git ) ]]; then + if [[ $url == /* && -z $branch \ + && ( $no_local_clone == true || ! -d $url/.git ) ]]; then make_local_clone=false fi @@ -82,7 +85,7 @@ antigen-bundle () { fi # Load the plugin. - -antigen-load "$url" "$loc" "$btype" "$make_local_clone" + -antigen-load "$url" "$loc" "$btype" "$make_local_clone" }