@@ -1224,33 +1224,6 @@ func (r *Repository) createNewObjectPack(cfg *RepackConfig) (h plumbing.Hash, er
1224
1224
return h , err
1225
1225
}
1226
1226
1227
- type DescribeOptions struct {
1228
- // Contains find the tag that comes after the commit
1229
- //Contains bool
1230
- // Debug search strategy on stderr
1231
- //Debug bool
1232
- // All Use any reference
1233
- //All bool
1234
- // Tags use any tag, even unannotated
1235
- //Tags bool
1236
- // FirstParent only follow first parent
1237
- //FirstParent bool
1238
- // Use <Abbrev> digits to display SHA-1s
1239
- // By default is 8
1240
- //Abbrev int
1241
- // Only output exact matches
1242
- //ExactMatch bool
1243
- // Consider <Candidates> most recent tags
1244
- // By default is 10
1245
- //Candidates int
1246
- // Only consider tags matching <Match> pattern
1247
- //Match string
1248
- // Show abbreviated commit object as fallback
1249
- //Always bool
1250
- // Append <mark> on dirty working tree (default: "-dirty")
1251
- Dirty string
1252
- }
1253
-
1254
1227
type Describe struct {
1255
1228
// Reference being described
1256
1229
Reference * plumbing.Reference
@@ -1272,7 +1245,10 @@ func (d *Describe) String() string {
1272
1245
1273
1246
// Describe just like the `git describe` command will return a Describe struct for the hash passed.
1274
1247
// Describe struct implements String interface so it can be easily printed out.
1275
- func (r * Repository ) Describe (ref * plumbing.Reference , options * DescribeOptions ) (* Describe , error ) {
1248
+ func (r * Repository ) Describe (ref * plumbing.Reference , opts * DescribeOptions ) (* Describe , error ) {
1249
+ if err := opts .Validate (); err != nil {
1250
+ return nil , err
1251
+ }
1276
1252
1277
1253
// Fetch the reference log
1278
1254
commitIterator , err := r .Log (& LogOptions {
@@ -1313,7 +1289,7 @@ func (r *Repository) Describe(ref *plumbing.Reference, options *DescribeOptions)
1313
1289
ref ,
1314
1290
tag ,
1315
1291
count ,
1316
- options .Dirty ,
1292
+ opts .Dirty ,
1317
1293
}, nil
1318
1294
1319
1295
}
0 commit comments