<commit_before>// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:async';

import 'dart:io';
import 'package:path/path.dart' as path;
import 'package:pub/src/git.dart' as git;
import 'package:test_descriptor/test_descriptor.dart';

/// Describes a Git repository and its contents.
class GitRepoDescriptor extends DirectoryDescriptor {
  GitRepoDescriptor(String name, List<Descriptor> contents)
      : super(name, contents);

  /// Creates the Git repository and commits the contents.
  @override
  Future create([String parent]) async {
    await super.create(parent);
    await _runGitCommands(parent, [
      ['init'],
      [
        'config', 'core.excludesfile',
        // TODO(sigurdm): This works around https://github.com/dart-lang/sdk/issues/40060
        Platform.isWindows ? '""' : ''
      ],
      ['add', '.'],
      ['commit', '-m', 'initial commit', '--allow-empty']
    ]);
  }

  /// Writes this descriptor to the filesystem, then commits any changes from
  /// the previous structure to the Git repo.
  ///
  /// [parent] defaults to [sandbox].
  Future commit([String parent]) async {<commit_msg>Remove hack now issue has been fixed (#2773)<commit_after>// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:async';

import 'package:path/path.dart' as path;
import 'package:pub/src/git.dart' as git;
import 'package:test_descriptor/test_descriptor.dart';

/// Describes a Git repository and its contents.
class GitRepoDescriptor extends DirectoryDescriptor {
  GitRepoDescriptor(String name, List<Descriptor> contents)
      : super(name, contents);

  /// Creates the Git repository and commits the contents.
  @override
  Future create([String parent]) async {
    await super.create(parent);
    await _runGitCommands(parent, [
      ['init'],
      [
        'config',
        'core.excludesfile',
        '',
      ],
      ['add', '.'],
      ['commit', '-m', 'initial commit', '--allow-empty']
    ]);
  }

  /// Writes this descriptor to the filesystem, then commits any changes from
  /// the previous structure to the Git repo.
  ///
  /// [parent] defaults to [sandbox].
  Future commit([String parent]) async {
{'fraction_non_alphanumeric': 0.126, 'fraction_numerical': 0.0068, 'mean_word_length': 3.217537942664418, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6854194', 'n_tokens_mistral': 733, 'n_tokens_neox': 708, 'n_words': 251}