Skip to content

Commit

Permalink
spelling: regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoref committed Nov 8, 2017
1 parent 52a7e80 commit 6dfb321
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions commands/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ func clone(command *Command, args *Args) {

func transformCloneArgs(args *Args) {
isSSH := parseClonePrivateFlag(args)
hasValueRegxp := regexp.MustCompile("^(--(upload-pack|template|depth|origin|branch|reference|name)|-[ubo])$")
hasValueRegexp := regexp.MustCompile("^(--(upload-pack|template|depth|origin|branch|reference|name)|-[ubo])$")
nameWithOwnerRegexp := regexp.MustCompile(NameWithOwnerRe)
for i := 0; i < args.ParamsSize(); i++ {
a := args.Params[i]

if strings.HasPrefix(a, "-") {
if hasValueRegxp.MatchString(a) {
if hasValueRegexp.MatchString(a) {
i++
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions commands/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ func transformInitArgs(args *Args) error {

var err error
dirToInit := "."
hasValueRegxp := regexp.MustCompile("^--(template|separate-git-dir|shared)$")
hasValueRegexp := regexp.MustCompile("^--(template|separate-git-dir|shared)$")

// Find the first argument that isn't related to any of the init flags.
// We assume this is the optional `directory` argument to git init.
for i := 0; i < args.ParamsSize(); i++ {
arg := args.Params[i]
if hasValueRegxp.MatchString(arg) {
if hasValueRegexp.MatchString(arg) {
i++
} else if !strings.HasPrefix(arg, "-") {
dirToInit = arg
Expand Down

0 comments on commit 6dfb321

Please sign in to comment.