21 lines
821 B
Diff
21 lines
821 B
Diff
204a205,224
|
|
> // InitPrivateAnnex initializes a private annex in the repository
|
|
> func (t *TemporaryUploadRepository) InitPrivateAnnex() error {
|
|
> if _, _, err := git.NewCommand(t.ctx, "config", "annex.private", "true").RunStdString(&git.RunOpts{Dir: t.basePath}); err != nil {
|
|
> return err
|
|
> }
|
|
> if _, _, err := git.NewCommand(t.ctx, "annex", "init").RunStdString(&git.RunOpts{Dir: t.basePath}); err != nil {
|
|
> return err
|
|
> }
|
|
> return nil
|
|
> }
|
|
>
|
|
> // AddAnnex adds the file at path to the repository using git annex add
|
|
> // This requires a non-bare repository
|
|
> func (t *TemporaryUploadRepository) AddAnnex(path string) error {
|
|
> if _, _, err := git.NewCommand(t.ctx, "annex", "add").AddDynamicArguments(path).RunStdString(&git.RunOpts{Dir: t.basePath}); err != nil {
|
|
> return err
|
|
> }
|
|
> return nil
|
|
> }
|
|
>
|