You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
494 B
28 lines
494 B
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"os"
|
|
|
|
"dehub.dev/src/dehub.git"
|
|
)
|
|
|
|
type repo struct {
|
|
bare bool
|
|
|
|
*dehub.Repo
|
|
}
|
|
|
|
func (r *repo) initFlags(flag *flag.FlagSet) {
|
|
flag.BoolVar(&r.bare, "bare", false, "If set then the repo being opened will be expected to be bare")
|
|
}
|
|
|
|
func (r *repo) openRepo() error {
|
|
var err error
|
|
if r.Repo, err = dehub.OpenRepo(".", dehub.OpenBare(r.bare)); err != nil {
|
|
wd, _ := os.Getwd()
|
|
return fmt.Errorf("opening repo at %q: %w", wd, err)
|
|
}
|
|
return nil
|
|
}
|
|
|