| 1 | package commandsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/ |
| 2 | |
| 3 | import ( |
| 4 | "bufioscip-go gomod github.com/golang/go/src go1.25.0 bufio/" |
| 5 | "fmtscip-go gomod github.com/golang/go/src go1.25.0 fmt/" |
| 6 | "ioscip-go gomod github.com/golang/go/src go1.25.0 io/" |
| 7 | "stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/" |
| 8 | |
| 9 | "github.com/git-lfs/git-lfs/v3/errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/" |
| 10 | "github.com/git-lfs/git-lfs/v3/filepathfilterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/" |
| 11 | "github.com/git-lfs/git-lfs/v3/gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/" |
| 12 | "github.com/git-lfs/git-lfs/v3/git/githistoryscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/" |
| 13 | "github.com/git-lfs/git-lfs/v3/tasklogscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/" |
| 14 | "github.com/git-lfs/git-lfs/v3/trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/" |
| 15 | "github.com/git-lfs/gitobj/v2scip-go gomod github.com/git-lfs/gitobj/v2 v2.1.1 `github.com/git-lfs/gitobj/v2`/" |
| 16 | "github.com/spf13/cobrascip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/" |
| 17 | ) |
| 18 | |
| 19 | var ( |
| 20 | // migrateIncludeRefs is a set of Git references to explicitly include |
| 21 | // in the migration. |
| 22 | migrateIncludeRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateIncludeRefs. []string |
| 23 | // migrateExcludeRefs is a set of Git references to explicitly exclude |
| 24 | // in the migration. |
| 25 | migrateExcludeRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateExcludeRefs. []string |
| 26 | |
| 27 | // migrateYes indicates that an answer of 'yes' should be presumed |
| 28 | // whenever 'git lfs migrate' asks for user input. |
| 29 | migrateYesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateYes. bool |
| 30 | |
| 31 | // migrateSkipFetch assumes that the client has the latest copy of |
| 32 | // remote references, and thus should not contact the remote for a set |
| 33 | // of updated references. |
| 34 | migrateSkipFetchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateSkipFetch. bool |
| 35 | |
| 36 | // migrateImportAboveFmt indicates the presence of the --above=<size> |
| 37 | // flag and instructs 'git lfs migrate import' to import all files |
| 38 | // above the provided size. |
| 39 | migrateImportAboveFmtscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateImportAboveFmt. string |
| 40 | |
| 41 | // migrateEverything indicates the presence of the --everything flag, |
| 42 | // and instructs 'git lfs migrate' to migrate all local references. |
| 43 | migrateEverythingscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateEverything. bool |
| 44 | |
| 45 | // migrateVerbose enables verbose logging |
| 46 | migrateVerbosescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateVerbose. bool |
| 47 | |
| 48 | // objectMapFile is the path to the map of old sha1 to new sha1 |
| 49 | // commits |
| 50 | objectMapFilePathscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/objectMapFilePath. string |
| 51 | |
| 52 | // migrateNoRewrite is the flag indicating whether or not the |
| 53 | // command should rewrite git history |
| 54 | migrateNoRewritescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateNoRewrite. bool |
| 55 | // migrateCommitMessage is the message to use with the commit generated |
| 56 | // by the migrate command |
| 57 | migrateCommitMessagescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateCommitMessage. string |
| 58 | |
| 59 | // exportRemote is the remote from which to download objects when |
| 60 | // performing an export |
| 61 | exportRemotescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/exportRemote. string |
| 62 | |
| 63 | // migrateFixup is the flag indicating whether or not to infer the |
| 64 | // included and excluded filepath patterns. |
| 65 | migrateFixupscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateFixup. bool |
| 66 | ) |
| 67 | |
| 68 | // migrate takes the given command and arguments, *gitobj.ObjectDatabase, as well |
| 69 | // as a BlobRewriteFn to apply, and performs a migration. |
| 70 | func migratescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrate().(args []string, r *githistoryscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/.Rewriterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/Rewriter#, l *tasklogscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/.Loggerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/Logger#, opts *githistoryscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/.RewriteOptionsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/RewriteOptions#) { |
| 71 | setupRepositoryscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/setupRepository().() |
| 72 | |
| 73 | opts, err := rewriteOptionsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/rewriteOptions().(args, opts, l) |
| 74 | if err != nil { |
| 75 | ExitWithErrorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/ExitWithError().(err) |
| 76 | } |
| 77 | |
| 78 | _, err = r.Rewritescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/Rewriter#Rewrite().(opts) |
| 79 | if err != nil { |
| 80 | ExitWithErrorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/ExitWithError().(err) |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | // getObjectDatabase creates a *git.ObjectDatabase from the filesystem pointed |
| 85 | // at the .git directory of the currently checked-out repository. |
| 86 | func getObjectDatabasescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/getObjectDatabase().() (*gitobjscip-go gomod github.com/git-lfs/gitobj/v2 v2.1.1 `github.com/git-lfs/gitobj/v2`/.ObjectDatabasescip-go gomod github.com/git-lfs/gitobj/v2 v2.1.1 `github.com/git-lfs/gitobj/v2`/ObjectDatabase#, error) { |
| 87 | dir, err := gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.GitCommonDirscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GitCommonDir().() |
| 88 | if err != nil { |
| 89 | return nil, errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/.Wrapscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/Wrap().(err, trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("cannot open root")) |
| 90 | } |
| 91 | |
| 92 | return gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.ObjectDatabasescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/ObjectDatabase().(cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg..OSEnvscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Configuration#OSEnv().(), cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg..GitEnvscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Configuration#GitEnv().(), dir, cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg..TempDirscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Configuration#TempDir().()) |
| 93 | } |
| 94 | |
| 95 | // rewriteOptions returns *githistory.RewriteOptions able to be passed to a |
| 96 | // *githistory.Rewriter that reflect the current arguments and flags passed to |
| 97 | // an invocation of git-lfs-migrate(1). |
| 98 | // |
| 99 | // It is merged with the given "opts". In other words, an identical "opts" is |
| 100 | // returned, where the Include and Exclude fields have been filled based on the |
| 101 | // following rules: |
| 102 | // |
| 103 | // The included and excluded references are determined based on the output of |
| 104 | // includeExcludeRefs (see below for documentation and detail). |
| 105 | // |
| 106 | // If any of the above could not be determined without error, that error will be |
| 107 | // returned immediately. |
| 108 | func rewriteOptionsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/rewriteOptions().(args []string, opts *githistoryscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/.RewriteOptionsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/RewriteOptions#, l *tasklogscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/.Loggerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/Logger#) (*githistoryscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/.RewriteOptionsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/RewriteOptions#, error) { |
| 109 | include, exclude, err := includeExcludeRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/includeExcludeRefs().(l, args) |
| 110 | if err != nil { |
| 111 | return nil, err |
| 112 | } |
| 113 | |
| 114 | return &githistoryscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/.RewriteOptionsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/RewriteOptions#{ |
| 115 | Includescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/RewriteOptions#Include.: include, |
| 116 | Excludescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/RewriteOptions#Exclude.: exclude, |
| 117 | |
| 118 | UpdateRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/RewriteOptions#UpdateRefs.: opts.UpdateRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/RewriteOptions#UpdateRefs., |
| 119 | Verbosescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/RewriteOptions#Verbose.: opts.Verbosescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/RewriteOptions#Verbose., |
| 120 | ObjectMapFilePathscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/RewriteOptions#ObjectMapFilePath.: opts.ObjectMapFilePathscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/RewriteOptions#ObjectMapFilePath., |
| 121 | |
| 122 | BlobFnscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/RewriteOptions#BlobFn.: opts.BlobFnscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/RewriteOptions#BlobFn., |
| 123 | TreePreCallbackFnscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/RewriteOptions#TreePreCallbackFn.: opts.TreePreCallbackFnscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/RewriteOptions#TreePreCallbackFn., |
| 124 | TreeCallbackFnscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/RewriteOptions#TreeCallbackFn.: opts.TreeCallbackFnscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/RewriteOptions#TreeCallbackFn., |
| 125 | }, nil |
| 126 | } |
| 127 | |
| 128 | // isSpecialGitRef checks if a ref spec is a special git ref to exclude from |
| 129 | // --everything |
| 130 | func isSpecialGitRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/isSpecialGitRef().(refspec string) bool { |
| 131 | // Special refspecs. |
| 132 | switch refspec { |
| 133 | case "refs/stash": |
| 134 | return true |
| 135 | } |
| 136 | |
| 137 | // Special refspecs from namespaces. |
| 138 | parts := stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.SplitNscip-go gomod github.com/golang/go/src go1.25.0 strings/SplitN().(refspec, "/", 3) |
| 139 | if len(parts) < 3 { |
| 140 | return false |
| 141 | } |
| 142 | prefix := stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.Joinscip-go gomod github.com/golang/go/src go1.25.0 strings/Join().(parts[:2], "/") |
| 143 | switch prefix { |
| 144 | case "refs/notes", "refs/bisect", "refs/replace": |
| 145 | return true |
| 146 | } |
| 147 | return false |
| 148 | } |
| 149 | |
| 150 | // includeExcludeRefs returns fully-qualified sets of references to include, and |
| 151 | // exclude, or an error if those could not be determined. |
| 152 | // |
| 153 | // They are determined based on the following rules: |
| 154 | // |
| 155 | // - Include all local refs/heads/<branch> references for each branch |
| 156 | // specified as an argument. |
| 157 | // - Include the currently checked out branch if no branches are given as |
| 158 | // arguments and the --include-ref= or --exclude-ref= flag(s) aren't given. |
| 159 | // - Include all references given in --include-ref=<ref>. |
| 160 | // - Exclude all references given in --exclude-ref=<ref>. |
| 161 | func includeExcludeRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/includeExcludeRefs().(l *tasklogscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/.Loggerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/Logger#, args []string) (include, exclude []string, err error) { |
| 162 | hardcore := len(migrateIncludeRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateIncludeRefs.) > 0 || len(migrateExcludeRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateExcludeRefs.) > 0 |
| 163 | |
| 164 | if len(args) == 0 && !hardcore && !migrateEverythingscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateEverything. { |
| 165 | // If no branches were given explicitly AND neither |
| 166 | // --include-ref or --exclude-ref flags were given, then add the |
| 167 | // currently checked out reference. |
| 168 | current, err := currentRefToMigratescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/currentRefToMigrate().() |
| 169 | if err != nil { |
| 170 | return nil, nil, err |
| 171 | } |
| 172 | args = append(args, current.Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.) |
| 173 | } |
| 174 | |
| 175 | if migrateEverythingscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateEverything. && len(args) > 0 { |
| 176 | return nil, nil, errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/.Newscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/New().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Cannot use --everything with explicit reference arguments")) |
| 177 | } |
| 178 | |
| 179 | for _, name := range args { |
| 180 | var excluded bool |
| 181 | if stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.HasPrefixscip-go gomod github.com/golang/go/src go1.25.0 strings/HasPrefix().("^", name) { |
| 182 | name = name[1:] |
| 183 | excluded = true |
| 184 | } |
| 185 | |
| 186 | // Then, loop through each branch given, resolve that reference, |
| 187 | // and include it. |
| 188 | ref, err := gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.ResolveRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/ResolveRef().(name) |
| 189 | if err != nil { |
| 190 | return nil, nil, err |
| 191 | } |
| 192 | |
| 193 | if excluded { |
| 194 | exclude = append(exclude, ref.Refspecscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Refspec().()) |
| 195 | } else { |
| 196 | include = append(include, ref.Refspecscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Refspec().()) |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | if hardcore { |
| 201 | if migrateEverythingscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateEverything. { |
| 202 | return nil, nil, errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/.Newscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/New().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Cannot use --everything with --include-ref or --exclude-ref")) |
| 203 | } |
| 204 | |
| 205 | // If either --include-ref=<ref> or --exclude-ref=<ref> were |
| 206 | // given, append those to the include and excluded reference |
| 207 | // set, respectively. |
| 208 | include = append(include, migrateIncludeRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateIncludeRefs....) |
| 209 | exclude = append(exclude, migrateExcludeRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateExcludeRefs....) |
| 210 | } else if migrateEverythingscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateEverything. { |
| 211 | refs, err := gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.AllRefsInscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/AllRefsIn().("") |
| 212 | if err != nil { |
| 213 | return nil, nil, err |
| 214 | } |
| 215 | |
| 216 | for _, ref := range refs { |
| 217 | switch ref.Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type. { |
| 218 | case gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.RefTypeLocalBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalBranch., gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.RefTypeLocalTagscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalTag., |
| 219 | gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.RefTypeRemoteBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeRemoteBranch.: |
| 220 | |
| 221 | include = append(include, ref.Refspecscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Refspec().()) |
| 222 | case gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.RefTypeOtherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeOther.: |
| 223 | if isSpecialGitRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/isSpecialGitRef().(ref.Refspecscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Refspec().()) { |
| 224 | continue |
| 225 | } |
| 226 | include = append(include, ref.Refspecscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Refspec().()) |
| 227 | } |
| 228 | } |
| 229 | } else { |
| 230 | bare, err := gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.IsBarescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/IsBare().() |
| 231 | if err != nil { |
| 232 | return nil, nil, errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/.Wrapscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/Wrap().(err, trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Unable to determine bareness")) |
| 233 | } |
| 234 | |
| 235 | if !bare { |
| 236 | // Otherwise, if neither --include-ref=<ref> or |
| 237 | // --exclude-ref=<ref> were given, include no additional |
| 238 | // references, and exclude all remote references that |
| 239 | // are remote branches or remote tags. |
| 240 | remoteRefs, err := getRemoteRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/getRemoteRefs().(l) |
| 241 | if err != nil { |
| 242 | return nil, nil, err |
| 243 | } |
| 244 | |
| 245 | for remote, refs := range remoteRefs { |
| 246 | for _, ref := range refs { |
| 247 | exclude = append(exclude, |
| 248 | formatRefNamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/formatRefName().(ref, remote)) |
| 249 | } |
| 250 | } |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | return include, exclude, nil |
| 255 | } |
| 256 | |
| 257 | // getRemoteRefs returns a fully qualified set of references belonging to all |
| 258 | // remotes known by the currently checked-out repository, or an error if those |
| 259 | // references could not be determined. |
| 260 | func getRemoteRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/getRemoteRefs().(l *tasklogscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/.Loggerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/Logger#) (map[string][]*gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#, error) { |
| 261 | refs := make(map[string][]*gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#) |
| 262 | |
| 263 | remotes, err := gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.RemoteListscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RemoteList().() |
| 264 | if err != nil { |
| 265 | return nil, err |
| 266 | } |
| 267 | |
| 268 | if !migrateSkipFetchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateSkipFetch. { |
| 269 | if err := fetchRemoteRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchRemoteRefs().(l, remotes); err != nil { |
| 270 | return nil, err |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | for _, remote := range remotes { |
| 275 | var refsForRemote []*gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref# |
| 276 | if migrateSkipFetchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateSkipFetch. { |
| 277 | refsForRemote, err = gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.CachedRemoteRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/CachedRemoteRefs().(remote) |
| 278 | } else { |
| 279 | refsForRemote, err = gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.RemoteRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RemoteRefs().(remote, true) |
| 280 | } |
| 281 | |
| 282 | if err != nil { |
| 283 | return nil, err |
| 284 | } |
| 285 | |
| 286 | refs[remote] = refsForRemote |
| 287 | } |
| 288 | |
| 289 | return refs, nil |
| 290 | } |
| 291 | |
| 292 | func fetchRemoteRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchRemoteRefs().(l *tasklogscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/.Loggerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/Logger#, remotes []string) error { |
| 293 | w := l.Waiterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/Logger#Waiter().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Fetching remote refs")) |
| 294 | defer w.Completescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/WaitingTask#Complete().() |
| 295 | |
| 296 | return gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.Fetchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Fetch().(remotes...) |
| 297 | } |
| 298 | |
| 299 | // formatRefName returns the fully-qualified name for the given Git reference |
| 300 | // "ref". |
| 301 | func formatRefNamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/formatRefName().(ref *gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#, remote string) string { |
| 302 | if ref.Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type. == gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.RefTypeRemoteBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeRemoteBranch. { |
| 303 | return stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.Joinscip-go gomod github.com/golang/go/src go1.25.0 strings/Join().([]string{ |
| 304 | "refs", "remotes", remote, ref.Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.}, "/") |
| 305 | } |
| 306 | return ref.Refspecscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Refspec().() |
| 307 | |
| 308 | } |
| 309 | |
| 310 | // currentRefToMigrate returns the fully-qualified name of the currently |
| 311 | // checked-out reference, or an error if the reference's type was not a local |
| 312 | // branch. |
| 313 | func currentRefToMigratescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/currentRefToMigrate().() (*gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#, error) { |
| 314 | current, err := gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.CurrentRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/CurrentRef().() |
| 315 | if err != nil { |
| 316 | return nil, err |
| 317 | } |
| 318 | |
| 319 | if current.Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type. == gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.RefTypeOtherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeOther. || |
| 320 | current.Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type. == gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.RefTypeRemoteBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeRemoteBranch. { |
| 321 | |
| 322 | return nil, errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/.Newscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/New().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Cannot migrate non-local ref: %s", current.Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.)) |
| 323 | } |
| 324 | return current, nil |
| 325 | } |
| 326 | |
| 327 | // getHistoryRewriter returns a history rewriter that includes the filepath |
| 328 | // filter given by the --include and --exclude arguments. |
| 329 | func getHistoryRewriterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/getHistoryRewriter().(cmd *cobrascip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/.Commandscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#, db *gitobjscip-go gomod github.com/git-lfs/gitobj/v2 v2.1.1 `github.com/git-lfs/gitobj/v2`/.ObjectDatabasescip-go gomod github.com/git-lfs/gitobj/v2 v2.1.1 `github.com/git-lfs/gitobj/v2`/ObjectDatabase#, l *tasklogscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/.Loggerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/Logger#) *githistoryscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/.Rewriterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/Rewriter# { |
| 330 | include, exclude := getIncludeExcludeArgsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/getIncludeExcludeArgs().(cmd) |
| 331 | filter := buildFilepathFilterWithPatternTypescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/buildFilepathFilterWithPatternType().(cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg., include, exclude, false, filepathfilterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/.GitAttributesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/GitAttributes.) |
| 332 | |
| 333 | return githistoryscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/.NewRewriterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/NewRewriter().(db, |
| 334 | githistoryscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/.WithFilterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/WithFilter.(filter), githistoryscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/.WithLoggerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git/githistory`/WithLogger.(l)) |
| 335 | } |
| 336 | |
| 337 | func ensureWorkingCopyCleanscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/ensureWorkingCopyClean().(in ioscip-go gomod github.com/golang/go/src go1.25.0 io/.Readerscip-go gomod github.com/golang/go/src go1.25.0 io/Reader#, out ioscip-go gomod github.com/golang/go/src go1.25.0 io/.Writerscip-go gomod github.com/golang/go/src go1.25.0 io/Writer#) { |
| 338 | dirty, err := gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.IsWorkingCopyDirtyscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/IsWorkingCopyDirty().() |
| 339 | if err != nil { |
| 340 | ExitWithErrorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/ExitWithError().(errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/.Wrapscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/Wrap().(err, |
| 341 | trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Could not determine if working copy is dirty"))) |
| 342 | } |
| 343 | |
| 344 | if !dirty { |
| 345 | return |
| 346 | } |
| 347 | |
| 348 | var proceed bool |
| 349 | if migrateYesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateYes. { |
| 350 | proceed = true |
| 351 | } else { |
| 352 | answer := bufioscip-go gomod github.com/golang/go/src go1.25.0 bufio/.NewReaderscip-go gomod github.com/golang/go/src go1.25.0 bufio/NewReader().(in) |
| 353 | L: |
| 354 | for { |
| 355 | fmtscip-go gomod github.com/golang/go/src go1.25.0 fmt/.Fprintscip-go gomod github.com/golang/go/src go1.25.0 fmt/Fprint().(out, trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("override changes in your working copy? All uncommitted changes will be lost! [y/N] ")) |
| 356 | s, err := answer.ReadStringscip-go gomod github.com/golang/go/src go1.25.0 bufio/Reader#ReadString().('\n') |
| 357 | if err != nil { |
| 358 | if err == ioscip-go gomod github.com/golang/go/src go1.25.0 io/.EOFscip-go gomod github.com/golang/go/src go1.25.0 io/EOF. { |
| 359 | break L |
| 360 | } |
| 361 | ExitWithErrorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/ExitWithError().(errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/.Wrapscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/Wrap().(err, |
| 362 | trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Could not read answer"))) |
| 363 | } |
| 364 | |
| 365 | switch stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.TrimSpacescip-go gomod github.com/golang/go/src go1.25.0 strings/TrimSpace().(s) { |
| 366 | // TRANSLATORS: these are negative (no) responses. |
| 367 | case trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("n"), trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("N"), "": |
| 368 | proceed = false |
| 369 | break L |
| 370 | // TRANSLATORS: these are positive (yes) responses. |
| 371 | case trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("y"), trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Y"): |
| 372 | proceed = true |
| 373 | break L |
| 374 | } |
| 375 | |
| 376 | if !stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.HasSuffixscip-go gomod github.com/golang/go/src go1.25.0 strings/HasSuffix().(s, "\n") { |
| 377 | fmtscip-go gomod github.com/golang/go/src go1.25.0 fmt/.Fprintfscip-go gomod github.com/golang/go/src go1.25.0 fmt/Fprintf().(out, "\n") |
| 378 | } |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | if proceed { |
| 383 | fmtscip-go gomod github.com/golang/go/src go1.25.0 fmt/.Fprintlnscip-go gomod github.com/golang/go/src go1.25.0 fmt/Fprintln().(out, trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("changes in your working copy will be overridden ...")) |
| 384 | } else { |
| 385 | Exitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/Exit().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("working copy must not be dirty")) |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | func initscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/init().() { |
| 390 | info := NewCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/NewCommand().("info", migrateInfoCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateInfoCommand().) |
| 391 | info.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().IntVarscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#IntVar().(&migrateInfoTopNscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateInfoTopN., "top", 5, "--top=<n>") |
| 392 | info.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().StringVarscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#StringVar().(&migrateInfoAboveFmtscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateInfoAboveFmt., "above", "", "--above=<n>") |
| 393 | info.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().StringVarscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#StringVar().(&migrateInfoUnitFmtscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateInfoUnitFmt., "unit", "", "--unit=<unit>") |
| 394 | info.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().StringVarscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#StringVar().(&migrateInfoPointersscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateInfoPointers., "pointers", "", "Ignore, dereference, or include LFS pointer files") |
| 395 | info.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().BoolVarscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#BoolVar().(&migrateFixupscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateFixup., "fixup", false, "Infer filepaths based on .gitattributes") |
| 396 | |
| 397 | importCmd := NewCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/NewCommand().("import", migrateImportCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateImportCommand().) |
| 398 | importCmd.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().StringVarscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#StringVar().(&migrateImportAboveFmtscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateImportAboveFmt., "above", "", "--above=<n>") |
| 399 | importCmd.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().BoolVarscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#BoolVar().(&migrateVerbosescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateVerbose., "verbose", false, "Verbose logging") |
| 400 | importCmd.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().StringVarscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#StringVar().(&objectMapFilePathscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/objectMapFilePath., "object-map", "", "Object map file") |
| 401 | importCmd.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().BoolVarscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#BoolVar().(&migrateNoRewritescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateNoRewrite., "no-rewrite", false, "Add new history without rewriting previous") |
| 402 | importCmd.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().StringVarPscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#StringVarP().(&migrateCommitMessagescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateCommitMessage., "message", "m", "", "With --no-rewrite, an optional commit message") |
| 403 | importCmd.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().BoolVarscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#BoolVar().(&migrateFixupscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateFixup., "fixup", false, "Infer filepaths based on .gitattributes") |
| 404 | |
| 405 | exportCmd := NewCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/NewCommand().("export", migrateExportCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateExportCommand().) |
| 406 | exportCmd.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().BoolVarscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#BoolVar().(&migrateVerbosescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateVerbose., "verbose", false, "Verbose logging") |
| 407 | exportCmd.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().StringVarscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#StringVar().(&objectMapFilePathscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/objectMapFilePath., "object-map", "", "Object map file") |
| 408 | exportCmd.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().StringVarscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#StringVar().(&exportRemotescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/exportRemote., "remote", "", "Remote from which to download objects") |
| 409 | |
| 410 | RegisterCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/RegisterCommand().("migrate", nil, func(cmd *cobrascip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/.Commandscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#) { |
| 411 | cmd.PersistentFlagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#PersistentFlags().().StringVarPscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#StringVarP().(&includeArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/includeArg., "include", "I", "", "Include a list of paths") |
| 412 | cmd.PersistentFlagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#PersistentFlags().().StringVarPscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#StringVarP().(&excludeArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/excludeArg., "exclude", "X", "", "Exclude a list of paths") |
| 413 | |
| 414 | cmd.PersistentFlagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#PersistentFlags().().StringSliceVarscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#StringSliceVar().(&migrateIncludeRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateIncludeRefs., "include-ref", nil, "An explicit list of refs to include") |
| 415 | cmd.PersistentFlagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#PersistentFlags().().StringSliceVarscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#StringSliceVar().(&migrateExcludeRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateExcludeRefs., "exclude-ref", nil, "An explicit list of refs to exclude") |
| 416 | cmd.PersistentFlagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#PersistentFlags().().BoolVarscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#BoolVar().(&migrateEverythingscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateEverything., "everything", false, "Migrate all local references") |
| 417 | cmd.PersistentFlagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#PersistentFlags().().BoolVarscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#BoolVar().(&migrateSkipFetchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateSkipFetch., "skip-fetch", false, "Assume up-to-date remote references.") |
| 418 | |
| 419 | cmd.PersistentFlagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#PersistentFlags().().BoolVarPscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#BoolVarP().(&migrateYesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/migrateYes., "yes", "y", false, "Don't prompt for answers.") |
| 420 | |
| 421 | cmd.AddCommandscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#AddCommand().(exportCmd, importCmd, info) |
| 422 | }) |
| 423 | } |